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

Discussion in 'Python' started by John Nagle, Jan 3, 2008.

  1. John Nagle

    John Nagle Guest

    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.com" opens a TCP connection
    on which nothing is ever sent, while "http://www.example.com"
    yields a proper web page.

    Even Firefox doesn't time this out properly. Try "http://soton.ac.uk"
    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
    John Nagle, Jan 3, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S2V2aW4gQnVydG9u?=

    Pre-Send Request Headers, Pre-Send Request Content

    =?Utf-8?B?S2V2aW4gQnVydG9u?=, Dec 31, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,044
    =?Utf-8?B?S2V2aW4gQnVydG9u?=
    Dec 31, 2004
  2. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    672
    Eric Sosman
    Jul 8, 2003
  3. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,184
    Peter Shaggy Haywood
    Sep 20, 2005
  4. Jonathan Gardner

    Asynchronous urllib (urllib+asyncore)?

    Jonathan Gardner, Feb 26, 2008, in forum: Python
    Replies:
    1
    Views:
    468
    Terry Jones
    Feb 27, 2008
  5. Chris McDonald
    Replies:
    0
    Views:
    286
    Chris McDonald
    Nov 1, 2010
Loading...

Share This Page