Commits

5lava committed e17f060

Fix: EventBuffer::copyout() didn't work in some cases

  • Participants
  • Parent commits 18cc496

Comments (0)

Files changed (2)

File classes/buffer.c

 		return;
 	}
 
-	if (!Z_ISREF_P(zdata)) {
-		/* Was not passed by reference */
-		return;
-	}
-
 	PHP_EVENT_FETCH_BUFFER(b, zbuf);
 
 	data = emalloc(sizeof(char) * max_bytes + 1);
 	ZEND_ARG_INFO(0, len)
 ZEND_END_ARG_INFO();
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_evbuffer_copyout, 0, 0, 2)
+	ZEND_ARG_INFO(1, buf)
+	ZEND_ARG_INFO(0, len)
+ZEND_END_ARG_INFO();
+
 ZEND_BEGIN_ARG_INFO_EX(arginfo_evbuffer_len, 0, 0, 1)
 	ZEND_ARG_INFO(0, len)
 ZEND_END_ARG_INFO();
 	PHP_ME(EventBuffer, prepend,       arginfo_evbuffer_add,           ZEND_ACC_PUBLIC)
 	PHP_ME(EventBuffer, prependBuffer, arginfo_evbuffer_add_buffer,    ZEND_ACC_PUBLIC)
 	PHP_ME(EventBuffer, drain,         arginfo_evbuffer_len,           ZEND_ACC_PUBLIC)
-	PHP_ME(EventBuffer, copyout,       arginfo_evbuffer_remove,        ZEND_ACC_PUBLIC)
+	PHP_ME(EventBuffer, copyout,       arginfo_evbuffer_copyout,       ZEND_ACC_PUBLIC)
 	PHP_ME(EventBuffer, readLine,      arginfo_evbuffer_read_line,     ZEND_ACC_PUBLIC)
 	PHP_ME(EventBuffer, search,        arginfo_evbuffer_search,        ZEND_ACC_PUBLIC)
 	PHP_ME(EventBuffer, searchEol,     arginfo_evbuffer_search_eol,    ZEND_ACC_PUBLIC)