curl: output protocol headers using binary mode
authorMarc Hoersken <info@marc-hoersken.de>
Sat, 1 Feb 2014 13:02:34 +0000 (14:02 +0100)
committerMarc Hoersken <info@marc-hoersken.de>
Fri, 14 Feb 2014 19:12:28 +0000 (20:12 +0100)
Since protocol headers contain explicit line-endings there should
be no automatic conversion to ASCII text or CRLF line-endings.

This might break third party tools that already depend on this
behaviour. We might need to introduce an option to make this optional.

src/tool_operate.c

index 9c61623..0ecbcad 100644 (file)
@@ -369,6 +369,10 @@ static int operate_do(struct Configurable *config)
         heads.stream = newfile;
       }
     }
+    else {
+      /* always use binary mode for protocol header output */
+      set_binmode(heads.stream);
+    }
   }
 
   /* save the values of noprogress and isatty to restore them later on */