Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion gunicorn/workers/gthread.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def __init__(self, cfg, sock, client, server):
self.sock.setblocking(False)

def init(self):
if self.initialized:
return
self.initialized = True
self.sock.setblocking(True)

Expand Down Expand Up @@ -111,7 +113,6 @@ def _wrap_future(self, fs, conn):
fs.add_done_callback(self.finish_request)

def enqueue_req(self, conn):
conn.init()
# submit the connection to a worker
fs = self.tpool.submit(self.handle, conn)
self._wrap_future(fs, conn)
Expand Down Expand Up @@ -273,6 +274,7 @@ def handle(self, conn):
keepalive = False
req = None
try:
conn.init()
req = next(conn.parser)
if not req:
return (False, conn)
Expand Down
Loading