From: Stanislav Malyshev Date: Wed, 18 Jul 2001 10:47:54 +0000 (+0000) Subject: Prevent cURl from always outputting the header. Fix bug #12018 X-Git-Tag: PRE_TSRM_MERGE_PATCH~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2a7a6b0f693a0377c6057327c7f259fd5360a99;p=php Prevent cURl from always outputting the header. Fix bug #12018 --- diff --git a/ext/curl/curl.c b/ext/curl/curl.c index 8693a3d904..79bf5898b0 100644 --- a/ext/curl/curl.c +++ b/ext/curl/curl.c @@ -250,6 +250,7 @@ PHP_MINIT_FUNCTION(curl) #define PHP_CURL_RETURN 4 #define PHP_CURL_ASCII 5 #define PHP_CURL_BINARY 6 +#define PHP_CURL_IGNORE 7 /* {{{ curl_write */ @@ -416,6 +417,10 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx zval_ptr_dtor(&retval); break; } + case PHP_CURL_IGNORE: + length = size * nmemb; + + break; } return length; @@ -546,6 +551,7 @@ PHP_FUNCTION(curl_init) ch->handlers->write->method = PHP_CURL_STDOUT; ch->handlers->write->type = PHP_CURL_ASCII; ch->handlers->read->method = PHP_CURL_DIRECT; + ch->handlers->write_header->method = PHP_CURL_IGNORE; curl_easy_setopt(ch->cp, CURLOPT_NOPROGRESS, 1); curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 0);