X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_client_curl.c;h=52e5e0278788af16cb082dbaaa4a7a4901f9693a;hp=3200fa2cad21bc901f2e65d1f7924807f2dc476a;hb=4b123a5347d0f16003feb045a5304bbb91630d74;hpb=c1231f62c6f4ae58cc63bc3724f99d5fb207b83a diff --git a/php_http_client_curl.c b/php_http_client_curl.c index 3200fa2..52e5e02 100644 --- a/php_http_client_curl.c +++ b/php_http_client_curl.c @@ -16,14 +16,21 @@ #if PHP_HTTP_HAVE_CURL #if PHP_HTTP_HAVE_EVENT -# include # if !PHP_HTTP_HAVE_EVENT2 && /* just be really sure */ !(LIBEVENT_VERSION_NUMBER >= 0x02000000) +# include # define event_base_new event_init # define event_assign(e, b, s, a, cb, d) do {\ event_set(e, s, a, cb, d); \ event_base_set(b, e); \ } while(0) -# endif +# else +# if PHP_HTTP_HAVE_EVENT2 +# include +# include +# else +# error "libevent presence is unknown" +# endif +# endif # ifndef DBG_EVENTS # define DBG_EVENTS 0 # endif @@ -1762,11 +1769,12 @@ static int php_http_client_curl_once(php_http_client_t *h) static STATUS php_http_client_curl_exec(php_http_client_t *h) { - TSRMLS_FETCH_FROM_CTX(h->ts); - #if PHP_HTTP_HAVE_EVENT php_http_client_curl_t *curl = h->ctx; +#endif + TSRMLS_FETCH_FROM_CTX(h->ts); +#if PHP_HTTP_HAVE_EVENT if (curl->useevents) { php_http_curlm_timeout_callback(CURL_SOCKET_TIMEOUT, /*EV_READ|EV_WRITE*/0, h); do {