cvs: php4(PHP_4_0_7) /ext/curl curl.c php_curl.h

From: Date: Tue, 20 Nov 2001 11:55:34 +0000
Subject: cvs: php4(PHP_4_0_7) /ext/curl curl.c php_curl.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-8266@lists.php.net to get a copy of this message
sterling Tue Nov 20 06:55:34 2001 EDT Modified files: (Branch: PHP_4_0_7) /php4/ext/curl curl.c php_curl.h Log: Temporary fix not for the HEAD branch, this is the only way to avoid the segfault and *really* not fuck up the release cycle Index: php4/ext/curl/curl.c diff -u php4/ext/curl/curl.c:1.79.2.5 php4/ext/curl/curl.c:1.79.2.6 --- php4/ext/curl/curl.c:1.79.2.5 Tue Nov 20 06:32:50 2001 +++ php4/ext/curl/curl.c Tue Nov 20 06:55:34 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: curl.c,v 1.79.2.5 2001/11/20 11:32:50 sterling Exp $ */ +/* $Id: curl.c,v 1.79.2.6 2001/11/20 11:55:34 sterling Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -557,6 +557,7 @@ (*ch)->handlers->write = ecalloc(1, sizeof(php_curl_write)); (*ch)->handlers->write_header = ecalloc(1, sizeof(php_curl_write)); (*ch)->handlers->read = ecalloc(1, sizeof(php_curl_read)); + (*ch)->performed = 0; memset(&(*ch)->err, 0, sizeof((*ch)->err)); zend_llist_init(&(*ch)->to_free.str, sizeof(char *), @@ -772,7 +773,6 @@ HashTable *postfields; struct HttpPost *first = NULL; struct HttpPost *last = NULL; - char *postval; char *string_key = NULL; ulong num_key; uint string_key_len; @@ -879,6 +879,11 @@ } ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); + if (ch->performed) { + php_error(E_WARNING, "Multiple executions on the same handle are not currently supported, please upgrade to the next version of PHP"); + RETURN_FALSE; + } + error = curl_easy_perform(ch->cp); if (error != CURLE_OK) { if (ch->handlers->write->buf.c) @@ -886,6 +891,8 @@ SAVE_CURL_ERROR(ch, error); RETURN_FALSE; } + + ch->performed = 1; if (ch->handlers->write->method == PHP_CURL_RETURN) { if (ch->handlers->write->type != PHP_CURL_BINARY) Index: php4/ext/curl/php_curl.h diff -u php4/ext/curl/php_curl.h:1.25 php4/ext/curl/php_curl.h:1.25.2.1 --- php4/ext/curl/php_curl.h:1.25 Mon Jun 25 11:14:20 2001 +++ php4/ext/curl/php_curl.h Tue Nov 20 06:55:34 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_curl.h,v 1.25 2001/06/25 15:14:20 sterling Exp $ */ +/* $Id: php_curl.h,v 1.25.2.1 2001/11/20 11:55:34 sterling Exp $ */ #ifndef _PHP_CURL_H #define _PHP_CURL_H @@ -41,6 +41,7 @@ #define CURLOPT_BINARYTRANSFER 19914 PHP_MINIT_FUNCTION(curl); +PHP_MSHUTDOWN_FUNCTION(curl); PHP_MINFO_FUNCTION(curl); PHP_FUNCTION(curl_version); PHP_FUNCTION(curl_init); @@ -90,6 +91,7 @@ struct _php_curl_error err; struct _php_curl_free to_free; long id; + int performed; } php_curl;

« previous php.cvs (#8266) next »