From fc96d45838e73bdf1b9ede89cae33c6b0c15a16c Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Mon, 8 Nov 2010 12:55:08 -0500 Subject: [PATCH] Set the correct Connection header in sync workers. We forgot to force this when we changed to HTTP/1.1 responses for the async worker classes. Thanks to @russss on Twitter for the report. --- gunicorn/workers/sync.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gunicorn/workers/sync.py b/gunicorn/workers/sync.py index 23d6b453..e3c9e62d 100644 --- a/gunicorn/workers/sync.py +++ b/gunicorn/workers/sync.py @@ -93,10 +93,13 @@ class SyncWorker(base.Worker): self.cfg.pre_request(self, req) resp, environ = wsgi.create(req, client, addr, self.address, self.cfg) + # Force the connection closed until someone shows + # a buffering proxy that supports Keep-Alive to + # the backend. + resp.force_close() self.nr += 1 if self.nr >= self.max_requests: self.log.info("Autorestarting worker after current request.") - resp.force_close() self.alive = False respiter = self.wsgi(environ, resp.start_response) for item in respiter: