Commits

Ruslan Osmanov committed 1f2310e

Fix: arginfoes of EventBufferEvent::createPair and EventBufferEvent::connect
Fix: some of the doc comments

Comments (0)

Files changed (5)

classes/buffer_event.c

  		 * e.g. by means of bufferevent_socket_connect()
  		 * which allocates new socket stream in this case. */
 		fd = -1;
+		/* User has no access to the file descriptor created
+		 * internally(bufferevent_getfd is not exposed to userspace at the
+		 * moment). Therefore, we have to make it close-on-free. */
+		options |= BEV_OPT_CLOSE_ON_FREE;
 	}
 
 	PHP_EVENT_FETCH_BASE(base, zbase);
 }
 /* }}} */
 
-/* {{{ proto bool EventBufferEvent::connectHost(resource dns_base, string hostname, int port[, int family = EVENT_AF_UNSPEC]);
+/* {{{ proto bool EventBufferEvent::connectHost(EventDnsBase dns_base, string hostname, int port[, int family = EVENT_AF_UNSPEC]);
  *
  * Resolves the DNS name hostname, looking for addresses of type
  * family(EVENT_AF_* constants). If the name resolution fails, it invokes the
 /* }}} */
 
 /* {{{ proto bool EventBufferEvent::write(string data);
- * Adds `data' to a buffe revent's output buffer. */
+ * Adds `data' to a buffer event's output buffer. */
 PHP_METHOD(EventBufferEvent, write)
 {
 	zval               *zbevent = getThis();
 /* }}} */
 
 /* {{{ proto bool EventBufferEvent::readBuffer(EventBuffer buf);
- * Drains the entire contents of the input buffer and places them into buf; it returns 0 on success and -1 on failure. */
+ * Drains the entire contents of the input buffer and places them into buf */
 PHP_METHOD(EventBufferEvent, readBuffer)
 {
 	zval               *zbevent = getThis();
 }
 /* }}} */
 
-/* {{{ proto EventBufferEvent EventBufferEvent::sslSocket(EventBase base, resource socket, EventSslContext ctx, int state[, int options = 0]);
+/* {{{ proto EventBufferEvent EventBufferEvent::sslSocket(EventBase base, mixed socket, EventSslContext ctx, int state[, int options = 0]);
  * */
 PHP_METHOD(EventBufferEvent, sslSocket)
 {
 
 /* {{{ proto EventDnsBase EventDnsBase::__construct(EventBase base, bool initialize);
  *
- * Returns resource representing event dns base.
+ * Returns object representing event dns base.
  *
  * If the initialize argument is true, it tries to configure the DNS base
  * sensibly given your operating system’s default. Otherwise, it leaves the

classes/event_config.c

 #include "src/priv.h"
 
 /* {{{ proto EventConfig::__construct(void);
- * On success returns a valid resource representing an event configuration
+ * On success returns an object representing an event configuration
  * which can be passed to EventBase::__construct. */
 PHP_METHOD(EventConfig, __construct)
 {
 /* }}} */
 
 #if LIBEVENT_VERSION_NUMBER >= 0x02010000
-/* {{{ proto void EventConfig:setMaxDispatchInterval(int max_interval, int max_callbacks, int min_priority);
+/* {{{ proto void EventConfig::setMaxDispatchInterval(int max_interval, int max_callbacks, int min_priority);
  * Prevents priority inversion by limiting how many low-priority event
  * callbacks can be invoked before checking for more high-priority events.
  * Available since libevent 2.1.0-alpha. */
 
 /* {{{ proto EventHttp EventHttp::__construct(EventBase base);
  *
- * Creates new http server resource.
+ * Creates new http server object.
  */
 PHP_METHOD(EventHttp, __construct)
 {
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_bufferevent__construct, 0, 0, 1)
 	ZEND_ARG_INFO(0, base)
-	ZEND_ARG_INFO(0, fd)
+	ZEND_ARG_INFO(0, socket)
 	ZEND_ARG_INFO(0, options)
+	ZEND_ARG_INFO(0, readcb)
+	ZEND_ARG_INFO(0, writecb)
+	ZEND_ARG_INFO(0, eventcb)
 ZEND_END_ARG_INFO();
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_bufferevent_connect, 0, 0, 2)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bufferevent_connect, 0, 0, 1)
 	ZEND_ARG_INFO(0, addr)
 	ZEND_ARG_INFO(0, sync_resolve)
 ZEND_END_ARG_INFO();
 	ZEND_ARG_INFO(0, size)
 ZEND_END_ARG_INFO();
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_bufferevent_pair_new, 0, 0, 2)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bufferevent_pair_new, 0, 0, 1)
 	ZEND_ARG_INFO(0, base)
-	ZEND_ARG_INFO(0, events)
+	ZEND_ARG_INFO(0, options)
 ZEND_END_ARG_INFO();
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_bufferevent_priority_set, 0, 0, 1)
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.