mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Send Keep-Alive header
This commit is contained in:
parent
886323b52f
commit
ea36277c99
@ -578,6 +578,9 @@ class HTTPPair(object):
|
|||||||
self.sent_headers = True
|
self.sent_headers = True
|
||||||
self.outheaders.set('Date', http_date(), replace_all=True)
|
self.outheaders.set('Date', http_date(), replace_all=True)
|
||||||
self.outheaders.set('Server', 'calibre %s' % __version__, replace_all=True)
|
self.outheaders.set('Server', 'calibre %s' % __version__, replace_all=True)
|
||||||
|
keep_alive = not self.close_connection and self.server_loop.opts.timeout > 0
|
||||||
|
if keep_alive:
|
||||||
|
self.outheaders.set('Keep-Alive', 'timeout=%d' % self.server_loop.opts.timeout)
|
||||||
if 'Connection' not in self.outheaders:
|
if 'Connection' not in self.outheaders:
|
||||||
if self.response_protocol is HTTP11:
|
if self.response_protocol is HTTP11:
|
||||||
if self.close_connection:
|
if self.close_connection:
|
||||||
|
@ -32,8 +32,8 @@ raw_options = (
|
|||||||
'request_queue_size', 5,
|
'request_queue_size', 5,
|
||||||
None,
|
None,
|
||||||
|
|
||||||
'Timeout in seconds for accepted connections',
|
'Time (in seconds) after which an idle connection is closed',
|
||||||
'timeout', 10.0,
|
'timeout', 60.0,
|
||||||
None,
|
None,
|
||||||
|
|
||||||
'Total time in seconds to wait for clean shutdown',
|
'Total time in seconds to wait for clean shutdown',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user