mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix websocket with protocol 076. Fix from tom on irc. Thanks!
This commit is contained in:
parent
9bc19c2c86
commit
a461817309
@ -470,6 +470,7 @@ class Arbiter(object):
|
||||
worker = self.WORKERS.pop(pid)
|
||||
worker.tmp.close()
|
||||
os.unlink(worker.tmpname)
|
||||
return
|
||||
except (KeyError, OSError):
|
||||
return
|
||||
raise
|
||||
|
||||
@ -79,6 +79,8 @@ class Message(object):
|
||||
clength = None
|
||||
elif name.upper() == "TRANSFER-ENCODING":
|
||||
chunked = value.lower() == "chunked"
|
||||
elif name.upper() == "SEC-WEBSOCKET-KEY1":
|
||||
clength = 8
|
||||
|
||||
if chunked:
|
||||
self.body = Body(ChunkedReader(self, self.unreader))
|
||||
|
||||
@ -41,9 +41,10 @@ class GEventWorker(AsyncWorker):
|
||||
break
|
||||
gevent.sleep(0.1)
|
||||
|
||||
pool.join(timeout=self.timeout)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
pool.join(timeout=self.timeout)
|
||||
os._exit(3)
|
||||
|
||||
def acceptor(self, pool):
|
||||
@ -55,6 +56,8 @@ class GEventWorker(AsyncWorker):
|
||||
gt._conn = conn
|
||||
gt.link(self.cleanup)
|
||||
conn, addr, gt = None, None, None
|
||||
except KeyboardInterrupt:
|
||||
return
|
||||
except greenlet.GreenletExit:
|
||||
return
|
||||
except:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user