From f22af669e84cd5db40942cf0ac339e7e8473f941 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 27 May 2015 10:50:52 +0530 Subject: [PATCH] Change default timeout to 120 seconds and ensure Keep-Alive header uses integers --- src/calibre/srv/http_response.py | 2 +- src/calibre/srv/opts.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/srv/http_response.py b/src/calibre/srv/http_response.py index aa2d3313be..57e79e2b66 100644 --- a/src/calibre/srv/http_response.py +++ b/src/calibre/srv/http_response.py @@ -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: diff --git a/src/calibre/srv/opts.py b/src/calibre/srv/opts.py index 1e027e50b9..7b545caf26 100644 --- a/src/calibre/srv/opts.py +++ b/src/calibre/srv/opts.py @@ -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',