</lead>
<date>2016-08-22</date>
<version>
- <release>2.6.0beta1</release>
+ <release>2.6.0beta2</release>
<api>2.6.0</api>
</version>
<stability>
#ifndef PHP_EXT_HTTP_H
#define PHP_EXT_HTTP_H
-#define PHP_PECL_HTTP_VERSION "2.6.0beta1"
+#define PHP_PECL_HTTP_VERSION "2.6.0beta2"
extern zend_module_entry http_module_entry;
#define phpext_http_ptr &http_module_entry
{
php_http_client_curl_t *curl = h->ctx;
- if (curl->ev_ops) {
- curl->ev_ops->once(curl->ev_ctx);
- } else {
- while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(curl->handle->multi, &curl->unfinished));
- }
+ if (!h->callback.depth) {
+ if (curl->ev_ops) {
+ curl->ev_ops->once(curl->ev_ctx);
+ } else {
+ while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(curl->handle->multi, &curl->unfinished));
+ }
- php_http_client_curl_responsehandler(h);
+ php_http_client_curl_responsehandler(h);
+ }
return curl->unfinished;
-
}
static ZEND_RESULT_CODE php_http_client_curl_exec(php_http_client_t *h)
--- /dev/null
+--TEST--
+client eventloop recursion
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+include "helper/server.inc";
+
+class test implements SplObserver {
+ function update(SplSubject $client) {
+ $client->once();
+ }
+}
+server("proxy.inc", function($port) {
+ $client = new http\Client;
+ $client->configure([
+ "use_eventloop" => true,
+ ]);
+ $client->attach(new test);
+ $client->enqueue(new http\Client\Request("GET", "http://localhost:$port/"), function($r) {
+ var_dump($r->getResponseCode());
+ });
+ $client->send();
+});
+
+?>
+===DONE===
+--EXPECTF--
+Test
+int(200)
+===DONE===
\ No newline at end of file