A problem with urllib

Aki Niimura akineko at pacbell.net
Tue Jul 2 15:14:30 EDT 2002


Bryan Olson <fakeaddress at nowhere.org> wrote in message news:<3D2163E3.3050605 at nowhere.org>...
> I did some diagnosis, and the problem seems to be a Linksys bug.   The
> router insists on getting the entire request in a single read, rather
> than reading until the end of the headers (and content if present).  The
> URL library must be sending one line at a time or something like that.

I can imagine they assumed all headers are sent in a single packet.
Obviously it makes easier to program. But as you pointed out, that is
not a correct implementation. 

> The code below runs through two cases: the first retrieves the resource
> as it should, and the second triggers the router bug.  In the second
> case, the router returns an "HTTP/1.1 401 Authorization Required" error
> response, even though we send exactly the same request as in the first
> case.

Bryan, thank you for experimenting this. I run your demo script
in my environment, however, I got "HTTP/1.1 401 Authorization
Required"
in both cases. Bryan, if you have tested your script with Linksys DSL
router, could you provide me the type of router (mine is BEFSR41) and
the firmware version (mine is 1.42.7)?

I tried the script both from Solaris and from Windows, but I got the
same result.

Any further suggestions are also appreciated.

Best regards,
Aki Niimura



More information about the Python-list mailing list