cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH 4/5] curl: output protocol headers using binary mode

From: Marc Hoersken <info_at_marc-hoersken.de>
Date: Sat, 1 Feb 2014 14:02:34 +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 | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 801e5d4..93d6d73 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -468,6 +468,10 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
         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 */
-- 
1.8.1.msysgit.1
--------------090806010803040708060007
Content-Type: application/gzip;
 name="0005-HTTP-tests-use-CRLF-as-header-seperator-according-to.patch.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename*0="0005-HTTP-tests-use-CRLF-as-header-seperator-according-to.pa";
 filename*1="tch.gz"
H4sICDrx7FIACzAwMDUtSFRUUC10ZXN0cy11c2UtQ1JMRi1hcy1oZWFkZXItc2VwZXJhdG9y
LWFjY29yZGluZy10by5wYXRjaADtnP9vo0YWwH9Hyv/wlOrUTR0wM8AM426i7WU33arda27X
VXU63Q8DDIm7DliAt410f3xnIGy8DhiM3YrgWJG/wJvHzJvnz3vMvPgyiW/BDRlxKPZFQFgQ
MtfymM9NP0SE2CEJkE9cM8SugHdxBB/EAhAF05zkf4BNE2mXUs0E3vHEh7exSNKPIoKXsyiM
X93KY/rN/TEjEOfaa56JCXzg2SkguBSe1IBsQPbEtCaOAyMTmab2Yen9JvxsAv+9+m568Rac
sfM/eDudXkEm0iydwDIVcPH+p0vgKdwIHogEUrEQCc/iBLjvx0kwi64hi+H95YUGmCCiab8s
AnnxFLIbkeuBdDnLhBK64VEwF+D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O2noE9mPUd4eY/mudXuMH9rLtgQupS1AWSkNRaLGu5iLTHwRRl7mg7r/1EB8
VslnVm48WA4VFjIMm3PuB24T8Vkt8VlBfFQQHzUQnw2V+GzQX+um0bUhvl0Q3+5KfPbsGgNw
jS+JT3Pi054Tn+1IfPa3EJ+hKj4zVG5pIOR5TmgYJvMJNXkD8WW7GuLLM1vk+LJXwyQ+Q0P+
WjeO7m/I8Rl6do0BuMYTzPEltHYiftl+Z+JLNmvIcA1k3KZ3qQS/gTTtT1cNLDsjWQAA
--------------090806010803040708060007
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
--------------090806010803040708060007--
Received on 2001-09-17