From 1f70cdef985aa5635a4f84be612b242ccaa8a10b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 23 Jun 2015 16:53:02 -0700 Subject: tool_header_cb: fflush the header stream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flush the header stream when -D is used so that they are sent off earlier. Bug: https://github.com/bagder/curl/issues/324 Reported-by: Cédric Connes --- src/tool_cb_hdr.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tool_cb_hdr.c') diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c index af9bb87ea..fd208e862 100644 --- a/src/tool_cb_hdr.c +++ b/src/tool_cb_hdr.c @@ -75,6 +75,8 @@ size_t tool_header_cb(void *ptr, size_t size, size_t nmemb, void *userdata) size_t rc = fwrite(ptr, size, nmemb, heads->stream); if(rc != cb) return rc; + /* flush the stream to send off what we got earlier */ + (void)fflush(heads->stream); } /* -- cgit v1.2.3