flush
[m6w6/ext-http] / src / php_http_client_curl_event.c
index 9b1808b92f43be348222de8fc481a770c4ae139f..ea5f6afe8ba3f20385d541abc76ce41399674bb3 100644 (file)
 */
 
 #include "php_http_api.h"
-#include "php_http_client.h"
-#include "php_http_client_curl.h"
 
-#if PHP_HTTP_HAVE_CURL
-#if PHP_HTTP_HAVE_EVENT
-#      if !PHP_HTTP_HAVE_EVENT2 && /* just be really sure */ !(LIBEVENT_VERSION_NUMBER >= 0x02000000)
+#if PHP_HTTP_HAVE_LIBCURL
+#if PHP_HTTP_HAVE_LIBEVENT
+#      if !PHP_HTTP_HAVE_LIBEVENT2 && /* just be really sure */ !(LIBEVENT_VERSION_NUMBER >= 0x02000000)
 #              include <event.h>
 #              define event_base_new event_init
 #              define event_assign(e, b, s, a, cb, d) do {\
@@ -24,7 +22,7 @@
                        event_base_set(b, e); \
                } while(0)
 #      else
-#              if PHP_HTTP_HAVE_EVENT2
+#              if PHP_HTTP_HAVE_LIBEVENT2
 #                      include <event2/event.h>
 #                      include <event2/event_struct.h>
 #              else
@@ -67,7 +65,6 @@ static void php_http_client_curl_event_handler(void *context, curl_socket_t s, i
        CURLMcode rc;
        php_http_client_curl_event_context_t *ctx = context;
        php_http_client_curl_t *curl = ctx->client->ctx;
-       TSRMLS_FETCH_FROM_CTX(ctx->client->ts);
 
 #if DBG_EVENTS
        fprintf(stderr, "H");
@@ -78,7 +75,7 @@ static void php_http_client_curl_event_handler(void *context, curl_socket_t s, i
        } while (CURLM_CALL_MULTI_PERFORM == rc);
 
        if (CURLM_OK != rc) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s",  curl_multi_strerror(rc));
+               php_error_docref(NULL, E_WARNING, "%s",  curl_multi_strerror(rc));
        }
 
        php_http_client_curl_responsehandler(ctx->client);
@@ -144,7 +141,6 @@ static int php_http_client_curl_event_socket(CURL *easy, curl_socket_t sock, int
        php_http_client_curl_t *curl = ctx->client->ctx;
        int events = EV_PERSIST;
        php_http_client_curl_event_ev_t *ev = assign_data;
-       TSRMLS_FETCH_FROM_CTX(ctx->client->ts);
 
 #if DBG_EVENTS
        fprintf(stderr, "S");
@@ -176,7 +172,7 @@ static int php_http_client_curl_event_socket(CURL *easy, curl_socket_t sock, int
                        return 0;
 
                default:
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown socket action %d", action);
+                       php_error_docref(NULL, E_WARNING, "Unknown socket action %d", action);
                        return -1;
        }
 
@@ -235,7 +231,6 @@ static ZEND_RESULT_CODE php_http_client_curl_event_exec(void *context)
 {
        php_http_client_curl_event_context_t *ctx = context;
        php_http_client_curl_t *curl = ctx->client->ctx;
-       TSRMLS_FETCH_FROM_CTX(ctx->client->ts);
 
 #if DBG_EVENTS
        fprintf(stderr, "E");
@@ -289,8 +284,6 @@ static void php_http_client_curl_event_dtor(void **context)
        fprintf(stderr, "D");
 #endif
 
-       ZEND_ASSERT(ctx);
-
        curl = ctx->client->ctx;
 
        curl_multi_setopt(curl->handle->multi, CURLMOPT_SOCKETDATA, NULL);
@@ -321,8 +314,8 @@ php_http_client_curl_ops_t *php_http_client_curl_event_ops_get()
        return &php_http_client_curl_event_ops;
 }
 
-#endif /* PHP_HTTP_HAVE_EVENT */
-#endif /* PHP_HTTP_HAVE_CURL */
+#endif /* PHP_HTTP_HAVE_LIBEVENT */
+#endif /* PHP_HTTP_HAVE_LIBCURL */
 
 /*
  * Local variables: