mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 02:45:22 +00:00
THRIFT-3390 Tornado server should gracefully handle closed connections
Clidnt: Python.Tornado Patch: Christian Verkerk <christian@tubularlabs.com> This closes #654
This commit is contained in:
parent
a84e139215
commit
145749c7a2
@ -171,7 +171,13 @@ class TTornadoServer(tcpserver.TCPServer):
|
||||
|
||||
try:
|
||||
while not trans.stream.closed():
|
||||
try:
|
||||
frame = yield trans.readFrame()
|
||||
except TTransportException as e:
|
||||
if e.type == TTransportException.END_OF_FILE:
|
||||
break
|
||||
else:
|
||||
raise
|
||||
tr = TMemoryBuffer(frame)
|
||||
iprot = self._iprot_factory.getProtocol(tr)
|
||||
yield self._processor.process(iprot, oprot)
|
||||
|
Loading…
Reference in New Issue
Block a user