deserialize "close" message not expected (was not serialized).

closes #1103
pull/1108/head
sebres 2015-07-08 11:10:05 +02:00
parent 1ebea39ec5
commit 4aff396b05
1 changed files with 4 additions and 2 deletions

View File

@ -65,14 +65,16 @@ class RequestHandler(asynchat.async_chat):
def found_terminator(self):
# Pop whole buffer
buf = self.__buffer
message = self.__buffer
self.__buffer = []
# Joins the buffer items.
message = loads(CSPROTO.EMPTY.join(buf))
message = CSPROTO.EMPTY.join(message)
# Closes the channel if close was received
if message == CSPROTO.CLOSE:
self.close_when_done()
return
# Deserialize
message = loads(message)
# Gives the message to the transmitter.
message = self.__transmitter.proceed(message)
# Serializes the response.