]> granicus.if.org Git - php/commitdiff
# Actually fix the bug this time (I fixed another bug last time :)
authorSterling Hughes <sterling@php.net>
Sat, 28 Apr 2001 21:44:44 +0000 (21:44 +0000)
committerSterling Hughes <sterling@php.net>
Sat, 28 Apr 2001 21:44:44 +0000 (21:44 +0000)
ext/curl/curl.c
ext/curl/php_curl.h

index 6fac74852714ac7ecb5d8ee7c589e1d191c6e132..ad54b899c19c3252cab1858b5d0b3c4fc9f2ed6b 100644 (file)
@@ -580,9 +580,10 @@ PHP_FUNCTION(curl_exec)
                        php_error(E_WARNING, "Cannot initialize temporary file to save output from %s()", get_active_function_name());
                        RETURN_FALSE;
                }
-               
-               curl_easy_setopt(curl_handle->cp, CURLOPT_FILE, fp);
-               
+               curl_handle->tmp_fp = fp;
+
+               curl_easy_setopt(curl_handle->cp, CURLOPT_FILE, fp);            
+       
                is_temp_file = 1;
        
        } else if (curl_handle->return_transfer &&
@@ -803,6 +804,7 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc)
 {
        php_curl *curl_handle = (php_curl *)rsrc->ptr;
        curl_easy_cleanup(curl_handle->cp);
+       if (curl_handle->tmp_fp) fclose(curl_handle->tmp_fp);
        zend_llist_clean(&curl_handle->to_free);
        efree(curl_handle);
 }
index 838cb1d382ca27a2095dd0060005e6233b26c496..58ee10aa2be842af150819792eeac3ccd06f23eb 100644 (file)
@@ -55,6 +55,7 @@ typedef struct {
        int php_stdout;
        int cerrno;
        char error[CURL_ERROR_SIZE+1];
+       FILE *tmp_fp;
        CURL *cp;
        zend_llist to_free;
 } php_curl;