cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: [regression] -J with -O sometimes writes to stdout

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 20 Nov 2011 23:38:47 +0100 (CET)

On Sun, 20 Nov 2011, Dave Reisner wrote:

> I've noticied a regression between 7.22.0 and 7.23.0 -- downloading a file
> with the flags -O and -J results in the content being written to stdout if
> and only if there was no Content-Disposition header in the http response. If
> there is a C-D header with a filename attribute, the output is correctly
> written.

Thanks a lot.

I wrote up a test case that repeats this problem (test 1210) and I decided to
make sure that curl always sets the -O name first and by default and then let
the Content-Disposition logic override that at a later point if a name
actually comes. I believe that is roughly how the code flow worked before.

To make the new test 1210 work properly I had to patch curl slightly to allow
a custom -O output dir for testing.

I've attached my fix for this, just in case someone wants to check it out. I
intend to push this soon unless somone has any remark.

-- 
  / daniel.haxx.se


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2011-11-20