Commit 6f8fe67a authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

tommink[at]post.pl reported in bug report #1337723

(http://curl.haxx.se/bug/view.cgi?id=1337723) that curl could not upload
binary data from stdin on Windows if the data contained control-Z (hex 1a)
since that is treated as end-of-file when read in text mode. Gisle Vanem
pointed out the fix, and I made both -T and --data-binary take advantage of
it.
parent d49edc8e
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -9,6 +9,13 @@




Daniel (27 October 2005)
Daniel (27 October 2005)
- tommink[at]post.pl reported in bug report #1337723
  (http://curl.haxx.se/bug/view.cgi?id=1337723) that curl could not upload
  binary data from stdin on Windows if the data contained control-Z (hex 1a)
  since that is treated as end-of-file when read in text mode. Gisle Vanem
  pointed out the fix, and I made both -T and --data-binary take advantage of
  it.

- Jaz Fresh pointed out that if you used "-r [number]" as was wrongly described
- Jaz Fresh pointed out that if you used "-r [number]" as was wrongly described
  in the man page, curl would send an invalid HTTP Range: header. The correct
  in the man page, curl would send an invalid HTTP Range: header. The correct
  way would be to use "-r [number]-" or even "-r -[number]". Starting now,
  way would be to use "-r [number]-" or even "-r -[number]". Starting now,
+2 −1
Original line number Original line Diff line number Diff line
@@ -15,6 +15,7 @@ This release includes the following changes:


This release includes the following bugfixes:
This release includes the following bugfixes:


 o Windows uploads from stdin using curl can now contain ctrl-Z bytes
 o -r [num] would produce an invalid HTTP Range: header
 o -r [num] would produce an invalid HTTP Range: header
 o multi interface with multi IP hosts could leak socket descriptors
 o multi interface with multi IP hosts could leak socket descriptors
 o the GnuTLS code didn't handle rehandshakes
 o the GnuTLS code didn't handle rehandshakes
@@ -34,6 +35,6 @@ This release would not have looked like this without help, code, reports and
advice from friends like these:
advice from friends like these:


 Dave Dribin, Bradford Bruce, Temprimus, Ofer, Dima Barsky, Amol Pattekar, Jaz
 Dave Dribin, Bradford Bruce, Temprimus, Ofer, Dima Barsky, Amol Pattekar, Jaz
 Fresh
 Fresh, tommink[at]post.pl, Gisle Vanem


        Thanks! (and sorry if I forgot to mention someone)
        Thanks! (and sorry if I forgot to mention someone)
+9 −1
Original line number Original line Diff line number Diff line
@@ -1797,8 +1797,13 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */


          nextarg++; /* pass the @ */
          nextarg++; /* pass the @ */


          if(curlx_strequal("-", nextarg))
          if(curlx_strequal("-", nextarg)) {
            file = stdin;
            file = stdin;
#ifdef O_BINARY
            if(subletter == 'b') /* forced binary */
              setmode(fileno(stdin), O_BINARY);
#endif
          }
          else {
          else {
            file = fopen(nextarg, "rb");
            file = fopen(nextarg, "rb");
            if(!file)
            if(!file)
@@ -3620,6 +3625,9 @@ operate(struct Configurable *config, int argc, char *argv[])


        }
        }
        else if(uploadfile && curlx_strequal(uploadfile, "-")) {
        else if(uploadfile && curlx_strequal(uploadfile, "-")) {
#ifdef O_BINARY
          setmode(fileno(stdin), O_BINARY);
#endif
          infd = stdin;
          infd = stdin;
        }
        }