Issue 547093: urllib/httplib vs corrupted tcp/ip stack (original) (raw)

Created on 2002-04-22 14:03 by apederse, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (4)
msg10477 - (view) Author: Asle Pedersen (apederse) Date: 2002-04-22 14:03
I am trying to connect to a server (talouselama.fi) using urllib2. The server respond immediately after it has received the first package from the client (urllib2). Since httplib fragment http requests in a request package and subsequent header packages the server disregards any header information that is sendt using urllib2. I have used ethereal to trace the packages for the connection. I can provide a dump if necessary. This problem may well be due to a corruptet tcp/ip stack at the server (talouselama.fi) but shouldn't urllib handle this if any other browser does. (lynx, explorer, opera - no exception)?? /Asle
msg10478 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-04-29 00:47
Logged In: YES user_id=6380 Can you explain what you think httplib is doing wrong? Are you saying that it should buffer the whole request until it is ready to send it in a single send() request? If so, I don't think it is httplib's responsibility to fix this -- the server doesn't follow the HTTP protocol (which says nothing about keeping things together in a single packet), and its webmaster should be informed of the bug in his site. Other browsers probably happen to send the whole request in a single packet.
msg10479 - (view) Author: Asle Pedersen (apederse) Date: 2002-05-08 16:29
Logged In: YES user_id=152302 I do agree with you that is not httplib's responsibility to fix it. However my opinion is that at least we should try to find a work-around for this type of problem. I would hate being unable to connect to the site just because Python fails. I have been looking into the possibility that the problem is related to which http version that is used. I used python2.0 in my original experiment and it issued http/1.0 requests. Later on I also tried to connect to the server directly using httplib and HTTPConnection to issue http/1.1 requests but it did not make any difference. The server still responded before httplib had finished its request. Do you have any suggestions on a work-around?
msg10480 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2002-07-16 21:23
Logged In: YES user_id=31392 I changed httplib to send requests as a single packet in rev 1.60. The change was made to address a performance problem, but happens to fix the problem you had with the bogus server, too.
History
Date User Action Args
2022-04-10 16:05:15 admin set github: 36481
2002-04-22 14:03:57 apederse create