From: Pierre Joye Date: Sun, 28 Jun 2009 10:00:28 +0000 (+0000) Subject: - MFH: fix regression introduced by the fix for #48518 (Ilia, Rasmus) X-Git-Tag: php-5.2.11RC1~227 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fdd7bbac0f3eb0f6a685b6a43584c28d364df439;p=php - MFH: fix regression introduced by the fix for #48518 (Ilia, Rasmus) --- diff --git a/ext/curl/interface.c b/ext/curl/interface.c index c72cfa502f..8efa994c4f 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1829,6 +1829,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 {