]> granicus.if.org Git - curl/commitdiff
tool_header_cb: fflush the header stream
authorDaniel Stenberg <daniel@haxx.se>
Tue, 23 Jun 2015 23:53:02 +0000 (16:53 -0700)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Jun 2015 18:53:56 +0000 (11:53 -0700)
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

index af9bb87eac3dff16cf76b654329f202621d691b1..fd208e862ceab7a4c4b130d8b25d400448164165 100644 (file)
@@ -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);
   }
 
   /*