From: Daniel Stenberg Date: Tue, 23 Jun 2015 23:53:02 +0000 (-0700) Subject: tool_header_cb: fflush the header stream X-Git-Tag: curl-7_44_0~120 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f70cdef985aa5635a4f84be612b242ccaa8a10b;p=curl tool_header_cb: fflush the header stream 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 --- 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); } /*