mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Change default timeout to 120 seconds and ensure Keep-Alive header uses integers
This commit is contained in:
parent
ec521d58c5
commit
f22af669e8
@ -324,7 +324,7 @@ class HTTPConnection(HTTPRequest):
|
||||
outheaders.set('Server', 'calibre %s' % __version__, replace_all=True)
|
||||
keep_alive = not self.close_after_response and self.opts.timeout > 0
|
||||
if keep_alive:
|
||||
outheaders.set('Keep-Alive', 'timeout=%d' % self.opts.timeout)
|
||||
outheaders.set('Keep-Alive', 'timeout=%d' % int(self.opts.timeout))
|
||||
if 'Connection' not in outheaders:
|
||||
if self.response_protocol is HTTP11:
|
||||
if self.close_after_response:
|
||||
|
@ -29,7 +29,7 @@ raw_options = (
|
||||
None,
|
||||
|
||||
'Time (in seconds) after which an idle connection is closed',
|
||||
'timeout', 60.0,
|
||||
'timeout', 120.0,
|
||||
None,
|
||||
|
||||
'Total time in seconds to wait for clean shutdown',
|
||||
|
Loading…
x
Reference in New Issue
Block a user