Re: Authenticating large, dynamic posts

steve.kilbane@ind.alstom.com
Fri, 4 Jun 1999 17:53:16 +0100


At the end of the day, it wasn't really necessary. :-/

For starters, Marcel Grunauer posted a response to another thread in clpm that
authenticated on the first post, making repeated posts unnecessary (in my
circumstances).

Secondly, supplying a proper Content-Length header makes the web server much
more polite about sending back responses before http.pm is ready to receive
them, making the required behaviour less convoluted.

Thirdly, those two in combination mean that what I'm convinced is an NT TCP bug
doesn't get triggered, so I don't need that workaround.

So, what do I have?

Under DYNAMIC_FILE_UPLOAD, my HTTP::Request::Common.pm produces a closure that
holds onto its components, and which can be called several times (it uses seek()
to rewind files). Although this isn't necessary if you *know* you're going to
auth on the first go, it might be useful for someone if they're not expecting an
authentication response. I use this for computing Content-Length, anyway. As
with similar mods, it'll only work with normal files.

My LWP::Protocol::http.pm has had a bit of a battering. Without that
Content-Length, the web server was sending responses and RST packets
immediately, and there're mods to catch parts of the response that come back
before the request is entirely sent. There are also mods to cope with NT
flushing all unread data on receipt of RST, but essentially, there's still a
race condition in there. I was using this to catch both 401 and 500 responses.
Is it going to be useful to anyone else? I don't know.

If any of this sounds useful, I can clean it up for the list.

steve