[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

urllib timeout hole - long timeout if site doesn't send headers.

John Nagle

1/3/2008 6:22:00 PM

urllib has a "hole" in its timeout protection.

Using "socket.setdefaulttimeout" will make urllib time out if a
site doesn't open a TCP connection in the indicated time. But if the site
opens the TCP connection and never sends HTTP headers, it takes about
20 minutes for the read in urllib's "open" to time out.

There are some web servers that produce this behavior, and
many seem to be associated with British universities and nonprofits.
With these, requesting "http://example... opens a TCP connection
on which nothing is ever sent, while "http://www.example...
yields a proper web page.

Even Firefox doesn't time this out properly. Try "http://soton.a...
in Firefox, and be prepared for a long wait.

There was some active work in the urllib timeout area last summer.
What happened to that?

John Nagle