projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
reading RFCs educates
[m6w6/ext-http]
/
php_http_curl.c
diff --git
a/php_http_curl.c
b/php_http_curl.c
index 0c30f87e158f335d6de4698de8aabd32f320f1fe..91b476c3b5076e15997b5889879441519ef1d335 100644
(file)
--- a/
php_http_curl.c
+++ b/
php_http_curl.c
@@
-10,13
+10,10
@@
+--------------------------------------------------------------------+
*/
+--------------------------------------------------------------------+
*/
-#include "php_http.h"
+#include "php_http
_api
.h"
#if PHP_HTTP_HAVE_CURL
#if PHP_HTTP_HAVE_CURL
-#include "php_http_request.h"
-#include "php_http_request_pool.h"
-
#include <curl/curl.h>
#define PHP_HTTP_CURL_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= (((x)<<16) + ((y)<<8) + (z)))
#include <curl/curl.h>
#define PHP_HTTP_CURL_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= (((x)<<16) + ((y)<<8) + (z)))
@@
-24,10
+21,6
@@
# include <event.h>
#endif
# include <event.h>
#endif
-#include <ext/spl/spl_iterators.h>
-#include <Zend/zend_interfaces.h>
-
-
typedef struct php_http_curl_request {
CURL *handle;
typedef struct php_http_curl_request {
CURL *handle;
@@
-498,7
+491,7
@@
static int php_http_curl_request_pool_socket_callback(CURL *easy, curl_socket_t
ev = ecalloc(1, sizeof(php_http_request_pool_event_t));
ev->pool = pool;
curl_multi_assign(curl->handle, sock, ev);
ev = ecalloc(1, sizeof(php_http_request_pool_event_t));
ev->pool = pool;
curl_multi_assign(curl->handle, sock, ev);
- event_base_set(PHP_HTTP_G->
request_poo
l.event_base, &ev->evnt);
+ event_base_set(PHP_HTTP_G->
cur
l.event_base, &ev->evnt);
} else {
event_del(&ev->evnt);
}
} else {
event_del(&ev->evnt);
}
@@
-516,6
+509,7
@@
static int php_http_curl_request_pool_socket_callback(CURL *easy, curl_socket_t
case CURL_POLL_REMOVE:
efree(ev);
case CURL_POLL_REMOVE:
efree(ev);
+ /* no break */
case CURL_POLL_NONE:
return 0;
case CURL_POLL_NONE:
return 0;
@@
-549,7
+543,7
@@
static void php_http_curl_request_pool_timer_callback(CURLM *multi, long timeout
if (!event_initialized(curl->timeout)) {
event_set(curl->timeout, -1, 0, php_http_curl_request_pool_timeout_callback, pool);
if (!event_initialized(curl->timeout)) {
event_set(curl->timeout, -1, 0, php_http_curl_request_pool_timeout_callback, pool);
- event_base_set(PHP_HTTP_G->
request_poo
l.event_base, curl->timeout);
+ event_base_set(PHP_HTTP_G->
cur
l.event_base, curl->timeout);
} else if (event_pending(curl->timeout, EV_TIMEOUT, NULL)) {
event_del(curl->timeout);
}
} else if (event_pending(curl->timeout, EV_TIMEOUT, NULL)) {
event_del(curl->timeout);
}
@@
-1492,7
+1486,7
@@
static STATUS php_http_curl_request_pool_exec(php_http_request_pool_t *h)
#if DBG_EVENTS
fprintf(stderr, "X");
#endif
#if DBG_EVENTS
fprintf(stderr, "X");
#endif
- event_base_dispatch(PHP_HTTP_G->
request_poo
l.event_base);
+ event_base_dispatch(PHP_HTTP_G->
cur
l.event_base);
} while (curl->unfinished);
} else
#endif
} while (curl->unfinished);
} else
#endif