fix websocket with protocol 076. Fix from tom on irc. Thanks!

This commit is contained in:
benoitc 2010-06-24 16:20:48 +02:00
parent 9bc19c2c86
commit a461817309
3 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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))

View File

@ -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: