Commits

Ruslan Osmanov committed 53cf476

Fix: coding style

Comments (0)

Files changed (5)

classes/buffer_event.c

 				"Failed to allocate bufferevent for socket");
 		return;
 	}
-        bev->_internal = 0;
+	bev->_internal = 0;
 	bev->bevent = bevent;
 
 	bev->self = zself;
 	PHP_EVENT_FETCH_BEVENT(bev, zbevent);
 
 	if (bev->bevent) {
-                if(!bev->_internal){
-		    bufferevent_free(bev->bevent);
-                }
+		if (!bev->_internal) {
+			bufferevent_free(bev->bevent);
+		}
 		bev->bevent = 0;
 
 		/* Do it once */

classes/http_request.c

  * Returns EventBufferEvent object. */
 PHP_METHOD(EventHttpRequest, getEventBufferEvent)
 {
-	php_event_http_req_t *http_req;
-        struct evhttp_connection *conn;
-        php_event_bevent_t *bev;
+	php_event_http_req_t     *http_req;
+	struct evhttp_connection *conn;
+	php_event_bevent_t       *bev;
+
 	if (zend_parse_parameters_none() == FAILURE) {
 		return;
 	}
 	bev->self = return_value;
 	Z_ADDREF_P(return_value);
 	bev->input = bev->output = NULL;
-        bev->_internal = 1;
+	bev->_internal = 1;
 }
 /* }}} */
 
  * Returns EventHttpConnection object. */
 PHP_METHOD(EventHttpRequest, getEventHttpConnection)
 {
-	php_event_http_req_t *http_req;
-        struct evhttp_connection *conn;
-        php_event_http_conn_t    *evcon;
+	php_event_http_req_t     *http_req;
+	struct evhttp_connection *conn;
+	php_event_http_conn_t    *evcon;
 
 	if (zend_parse_parameters_none() == FAILURE) {
 		return;
 	_check_http_req_ptr(http_req);
 
 	PHP_EVENT_INIT_CLASS_OBJECT(return_value, php_event_http_conn_ce);
-        PHP_EVENT_FETCH_HTTP_CONN(evcon, return_value);
+	PHP_EVENT_FETCH_HTTP_CONN(evcon, return_value);
 	conn = evhttp_request_get_connection(http_req->ptr);
 	evcon->conn = conn;
 	evcon->base = NULL;
-        evcon->dns_base = NULL;
+	evcon->dns_base = NULL;
 	Z_ADDREF_P(return_value);
 }
 /* }}} */
 
-
 /* {{{ proto void EventHttpRequest::closeConnection(void);
  */
 PHP_METHOD(EventHttpRequest, closeConnection)
 {
-	php_event_http_req_t *http_req;
-        struct evhttp_connection *conn;
+	php_event_http_req_t     *http_req;
+	struct evhttp_connection *conn;
 
 	if (zend_parse_parameters_none() == FAILURE) {
 		return;
 
 	conn = evhttp_request_get_connection(http_req->ptr);
 	evhttp_connection_free(conn);
-//	evhttp_connection_done(conn);
 }
 /* }}} */
 
 const zend_function_entry php_event_http_req_ce_functions[] = {
 	PHP_ME(EventHttpRequest, __construct, arginfo_event_http_req__construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
 
-	PHP_ME(EventHttpRequest, free,             arginfo_event__void,                     ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, getCommand,       arginfo_event__void,                     ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, getHost,          arginfo_event__void,                     ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, getUri,           arginfo_event__void,                     ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, getResponseCode,  arginfo_event__void,                     ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, getInputHeaders,  arginfo_event__void,                     ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, getOutputHeaders, arginfo_event__void,                     ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, getInputBuffer,   arginfo_event__void,                     ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, getOutputBuffer,  arginfo_event__void,                     ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, sendError,        arginfo_event_http_req_send_error,       ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, sendReply,        arginfo_event_http_req_send_reply,       ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, sendReplyChunk,   arginfo_event_http_req_send_reply_chunk, ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, sendReplyEnd,     arginfo_event__void,                     ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, sendReplyStart,   arginfo_event_http_req_send_reply_start, ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, cancel,           arginfo_event__void,                     ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, addHeader,        arginfo_event_http_req_add_header,       ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, clearHeaders,     arginfo_event__void,                     ZEND_ACC_PUBLIC)
-	PHP_ME(EventHttpRequest, removeHeader,     arginfo_event_http_req_remove_header,    ZEND_ACC_PUBLIC)
-	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_ME(EventHttpRequest, free,                   arginfo_event__void,                     ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, getCommand,             arginfo_event__void,                     ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, getHost,                arginfo_event__void,                     ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, getUri,                 arginfo_event__void,                     ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, getResponseCode,        arginfo_event__void,                     ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, getInputHeaders,        arginfo_event__void,                     ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, getOutputHeaders,       arginfo_event__void,                     ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, getInputBuffer,         arginfo_event__void,                     ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, getOutputBuffer,        arginfo_event__void,                     ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, sendError,              arginfo_event_http_req_send_error,       ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, sendReply,              arginfo_event_http_req_send_reply,       ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, sendReplyChunk,         arginfo_event_http_req_send_reply_chunk, ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, sendReplyEnd,           arginfo_event__void,                     ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, sendReplyStart,         arginfo_event_http_req_send_reply_start, ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, cancel,                 arginfo_event__void,                     ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, addHeader,              arginfo_event_http_req_add_header,       ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, clearHeaders,           arginfo_event__void,                     ZEND_ACC_PUBLIC)
+	PHP_ME(EventHttpRequest, removeHeader,           arginfo_event_http_req_remove_header,    ZEND_ACC_PUBLIC)
+	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_EVENT_PROP_REQUIRE(b->buf);
 
 	MAKE_STD_ZVAL(*retval);
-	if(b && b->buf){
-	    ZVAL_LONG(*retval, evbuffer_get_length(b->buf));
-	}
-	else{
-	    ZVAL_LONG(*retval, 0);
+	if (b && b->buf){
+		ZVAL_LONG(*retval, evbuffer_get_length(b->buf));
+	} else {
+		ZVAL_LONG(*retval, 0);
 	}
 
 	return SUCCESS;
 	PHP_EVENT_OBJECT_HEAD;
 
 	struct bufferevent    *bevent;
-        int                   _internal;
+	int                   _internal;
 	zval                  *self;        /* Object itself. For callbacks                   */
 	zval                  *data;        /* User custom data                               */
 	zval                  *input;       /* Input buffer */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.