Changeset 3290

Show
Ignore:
Timestamp:
12/16/09 17:08:04 (10 years ago)
Author:
cemeyer
Message:

Fix httpretrieve_open() to use a default timeout if None is given.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/seattlelib/httpretrieve.repy

    r3289 r3290  
    2828 
    2929 
    30 def httpretrieve_open(url, http_query=None, http_post=None, http_header=None, header_timeout=30, content_timeout=30, httpheader_limit=8192, httpcontent_limit=4194304): 
     30def httpretrieve_open(url, http_query=None, http_post=None, http_header=None, header_timeout=None, content_timeout=None, httpheader_limit=8192, httpcontent_limit=4194304): 
    3131  """ 
    3232  <Purpose> 
     
    9999    Returns file like obj which can read the http content from http web server.  
    100100  """ 
     101 
     102  # Pick default values for header_timeout and content_timeout if None given. 
     103  if header_timeout is None: 
     104    header_timeout = 30 
     105  if content_timeout is None: 
     106    content_timeout = 30 
    101107   
    102108  # check if url is valid and get host, path, port and query from the given url 
     
    115121  # send http format request to http web server   
    116122  _httpretrieve_sendhttprequest(sock, httpheader)  
    117    
     123 
    118124  # receive the http header lines in a form of list from the http web server 
    119125  httpheaderlines = _httpretrieve_receive_httpheader(sock, header_timeout, httpheader_limit)