]> granicus.if.org Git - php/commitdiff
- fix regression introduced by the fix for #48518 (Ilia, Rasmus)
authorPierre Joye <pajoye@php.net>
Sat, 27 Jun 2009 21:20:25 +0000 (21:20 +0000)
committerPierre Joye <pajoye@php.net>
Sat, 27 Jun 2009 21:20:25 +0000 (21:20 +0000)
ext/curl/interface.c

index 9c2fc3317641a8978c8ad3fd7e0fd59132981848..6d40d6dd3c167753fc720783c8c37e5e2ea5d1cd 100644 (file)
@@ -2118,6 +2118,14 @@ PHP_FUNCTION(curl_exec)
                RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1);
        }
 
+       /* flush the file handle, so any remaining data is synched to disk */
+       if (ch->handlers->write->method == PHP_CURL_FILE && ch->handlers->write->fp) {
+               fflush(ch->handlers->write->fp);
+       }
+       if (ch->handlers->write_header->method == PHP_CURL_FILE && ch->handlers->write_header->fp) {
+               fflush(ch->handlers->write_header->fp);
+       }
+
        if (ch->handlers->write->method == PHP_CURL_RETURN) {
                RETURN_EMPTY_STRING();
        } else {