From 8e83d9e8b8bf18bd885133efb37586dc2e970e57 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Sat, 27 Jun 2009 21:20:25 +0000 Subject: [PATCH] - fix regression introduced by the fix for #48518 (Ilia, Rasmus) --- ext/curl/interface.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 9c2fc331764..6d40d6dd3c1 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -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 {