- no need to allocate two contexts for the same payload
authorMichael Wallner <mike@php.net>
Tue, 14 Jun 2005 16:36:27 +0000 (16:36 +0000)
committerMichael Wallner <mike@php.net>
Tue, 14 Jun 2005 16:36:27 +0000 (16:36 +0000)
http_request_api.c

index f82b0a7f4664160f928cb7c1a82b33d77250128b..2a4884ad9d2660f9419544464bae63a127d1dc16 100644 (file)
@@ -334,8 +334,9 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, const
        }
 
        if (response) {
-               HTTP_CURL_OPT(WRITEDATA, http_curl_callback_data(response));
-               HTTP_CURL_OPT(WRITEHEADER, http_curl_callback_data(response));
+               http_curl_callback_ctx *response_ctx = http_curl_callback_data(response);
+               HTTP_CURL_OPT(WRITEDATA, response_ctx);
+               HTTP_CURL_OPT(WRITEHEADER, response_ctx);
        }
 
        HTTP_CURL_OPT(HEADER, 0);