-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hrvoje Niksic wrote:
> Micah Cowan <[EMAIL PROTECTED]> writes:
> 
>> Actually, the reason it is not enabled by default is that (1) it is
>> broken in some respects that need addressing, and (2) as it is currently
>> implemented, it involves a significant amount of extra traffic,
>> regardless of whether the remote end actually ends up using
>> Content-Disposition somewhere.
> 
> I'm curious, why is this the case?  I thought the code was refactored
> to determine the file name after the headers arrive.  It certainly
> looks that way by the output it prints:
> 
> {mulj}[~]$ wget www.cnn.com
> [...]
> HTTP request sent, awaiting response... 200 OK
> Length: unspecified [text/html]
> Saving to: `index.html'       # not "saving to" only after the HTTP response
> 
> Where does the extra traffic come from?

Your example above doesn't set --content-disposition; if you do, there
is an extra HEAD request sent.

As to why this is the case, I believe it was so that we could properly
handle accepts/rejects, whereas we will otherwise usually assume that we
can match accept/reject against the URL itself (we currently do this
improperly for the "-nd -r" case, still matching using the generated
file name's suffix).

Beyond that, I'm not sure as to why, and it's my intention that it not
be done in 1.12. Removing it for 1.11 is too much trouble, as the
sending-HEAD and sending-GET is not nearly decoupled enough to do it
without risk (and indeed, we were seeing trouble where everytime we
"fixed" an issue with the send-head-first issue, something else would
break). I want to do some reworking of gethttp and http_loop before I
will feel comfortable in changing how they work.

> If it is not ready for general use, we should consider removing it
> from NEWS.

I had thought of that. The thing that has kept me from it so far is that
 it is a feature that is desired by many people, and for most of them,
it will work (the issues are pretty minor, and mainly corner-case,
except perhaps for the fact that they are apparently always downloaded
to the top directory, and not the one in which the URL was found).

And, if we leave it out of NEWS and documentation, then, when we answer
people who ask "How can I get Wget to respect Content-Disposition
headers?", the natural follow-up will be, "Why isn't this mentioned
anywhere in the documentation?". :)

> If not, it should be properly documented in the manual.

Yes... I should be more specific about its shortcomings.

> I am aware that the NEWS entry claims that the feature is experimental,
> but why even mention it if it's not ready for general consumption?
> Announcing experimental features in NEWS is a good way to make testers
> aware of them during the alpha/beta release cycle, but it should be
> avoid in production releases of mature software.

It's pretty much "good enough"; it's not where I want it, but it _is_
usable. The extra traffic is really the main reason I don't want it
on-by-default.

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHXUFY7M8hyUobTrERAkGPAJwLTDHPqdfP3kIN7Zfxmh8RmjbdMACaA6yG
bkKcZfTt0lGpbU79y+AYXF8=
=ZHEv
-----END PGP SIGNATURE-----

Reply via email to