mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Merge pull request #929 from wong2/dev
propagate proxy_protocol_info to keep-alive requests correctly, fix #923
This commit is contained in:
commit
ccb08b541d
@ -38,14 +38,17 @@ class AsyncWorker(base.Worker):
|
|||||||
self.handle_request(listener_name, req, client, addr)
|
self.handle_request(listener_name, req, client, addr)
|
||||||
else:
|
else:
|
||||||
# keepalive loop
|
# keepalive loop
|
||||||
proxy_protocol_info = req.proxy_protocol_info
|
proxy_protocol_info = {}
|
||||||
while True:
|
while True:
|
||||||
req = None
|
req = None
|
||||||
with self.timeout_ctx():
|
with self.timeout_ctx():
|
||||||
req = six.next(parser)
|
req = six.next(parser)
|
||||||
if not req:
|
if not req:
|
||||||
break
|
break
|
||||||
req.proxy_protocol_info = proxy_protocol_info
|
if req.proxy_protocol_info:
|
||||||
|
proxy_protocol_info = req.proxy_protocol_info
|
||||||
|
else:
|
||||||
|
req.proxy_protocol_info = proxy_protocol_info
|
||||||
self.handle_request(listener_name, req, client, addr)
|
self.handle_request(listener_name, req, client, addr)
|
||||||
except http.errors.NoMoreData as e:
|
except http.errors.NoMoreData as e:
|
||||||
self.log.debug("Ignored premature client disconnection. %s", e)
|
self.log.debug("Ignored premature client disconnection. %s", e)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user