Hello again,

attached you will find a new set of patches that also includes a change
to the actual curl tool:
  1.) Contains all the general and Windows independent fixes to HTTP and
RTSP header line-endings for custom libtool test cases.
  2.) Makes the custom libtool binaries use binary mode for stdout, just
like the curl tool does if --use-ascii is not explicitly specified and
also includes the required fixes to the test cases in order to support
that binary mode.
  3.) Contains all the general and Windows independent fixes to HTTP for
curl-tool test cases.
  4.) Makes the curl-tool output protocol headers in binary-mode.
  5.) Contains all the general and Windows independent fixes to HTTP for
curl-tool test cases that depend on binary-mode protocol header output.

curl currently outputs protocol headers in text-mode rather than in
binary-mode. Since this breaks protocol headers that use explicit
line-endings, like HTTP, I propose that we make it output headers in
binary-mode. The attached patch #4 contains a small change to make this
happen, but does not include a new option to make it optional. The
previous patch #3 was dropped from the set and instead already pushed to
the repository, because it was completely unrelated.

I would like to request some feedback if we need a new option for
binary-mode protocol header output, since third party software could
depend on curl's current behaviour.

Best regards,
Marc

Attachment: 0001-testsuite-changed-HTTP-and-RTSP-header-line-endings-.patch.gz
Description: application/gzip

Attachment: 0002-testsuite-use-binary-output-mode-for-custom-curl-tes.patch.gz
Description: application/gzip

Attachment: 0003-HTTP-tests-use-CRLF-as-header-seperator-according-to.patch.gz
Description: application/gzip

>From 75e17273d1072390822796d0c992160abc2239c6 Mon Sep 17 00:00:00 2001
From: Marc Hoersken <[email protected]>
Date: Sat, 1 Feb 2014 14:02:34 +0100
Subject: [PATCH 4/5] curl: output protocol headers using binary mode

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

Attachment: 0005-HTTP-tests-use-CRLF-as-header-seperator-according-to.patch.gz
Description: application/gzip

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to