Commits

rickysu committed 54f3795

merge upstream/master

Comments (0)

Files changed (3)

classes/http_request.c

 /* }}} */
 
 
+/* {{{ proto void EventHttpRequest::closeConnection(void);
+ */
+PHP_METHOD(EventHttpRequest, closeConnection)
+{
+	php_event_http_req_t *http_req;
+        struct evhttp_connection *conn;
+
+	if (zend_parse_parameters_none() == FAILURE) {
+		return;
+	}
+
+	PHP_EVENT_FETCH_HTTP_REQ(http_req, getThis());
+
+	_check_http_req_ptr(http_req);
+
+	conn = evhttp_request_get_connection(http_req->ptr);
+	evhttp_connection_free(conn);
+//	evhttp_connection_done(conn);
+}
+/* }}} */
+
+
 
 /* {{{ proto void EventHttpRequest::sendError(int error[, string reason = NULL]);
  * Send an HTML error message to the client.
 	PHP_ME(EventHttpRequest, findHeader,       arginfo_event_http_req_remove_header,    ZEND_ACC_PUBLIC)
 	PHP_ME(EventHttpRequest, getEventBufferEvent,   arginfo_event__void,                ZEND_ACC_PUBLIC)
         PHP_ME(EventHttpRequest, getEventHttpConnection,   arginfo_event__void,                ZEND_ACC_PUBLIC)
+        PHP_ME(EventHttpRequest, closeConnection,   arginfo_event__void,                ZEND_ACC_PUBLIC)
 
 	PHP_FE_END
 };
 PHP_METHOD(EventHttpRequest, findHeader);
 PHP_METHOD(EventHttpRequest, getEventBufferEvent);
 PHP_METHOD(EventHttpRequest, getEventHttpConnection);
+PHP_METHOD(EventHttpRequest, closeConnection);
 
 /* Extra API END }}} */
 #endif