mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Fix a bug spotted while testin parser in restkit.
This commit is contained in:
parent
a461817309
commit
46e8002ffc
@ -95,7 +95,10 @@ class ChunkedReader(object):
|
||||
raise InvalidChunkSize(chunk_size)
|
||||
|
||||
if chunk_size == 0:
|
||||
self.parse_trailers(unreader, rest_chunk)
|
||||
try:
|
||||
self.parse_trailers(unreader, rest_chunk)
|
||||
except NoMoreData:
|
||||
pass
|
||||
return (0, None)
|
||||
return (chunk_size, rest_chunk)
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ class ParseException(Exception):
|
||||
pass
|
||||
|
||||
class NoMoreData(ParseException):
|
||||
def __init__(self, buf):
|
||||
def __init__(self, buf=None):
|
||||
self.buf = buf
|
||||
def __str__(self):
|
||||
return "No more data after: %r" % self.buf
|
||||
|
||||
@ -39,12 +39,10 @@ class GEventWorker(AsyncWorker):
|
||||
self.log.info("Parent changed, shutting down: %s" % self)
|
||||
gevent.kill(acceptor)
|
||||
break
|
||||
gevent.sleep(0.1)
|
||||
|
||||
|
||||
gevent.sleep(0.1)
|
||||
pool.join(timeout=self.timeout)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
pool.join(timeout=self.timeout)
|
||||
os._exit(3)
|
||||
|
||||
def acceptor(self, pool):
|
||||
@ -56,8 +54,6 @@ 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