Commit 80538863 authored by Stijn's avatar Stijn

Fixed issue where server crashes when client closes connection

parent 6303f518
......@@ -185,7 +185,7 @@ class ControlFrame(Frame):
is given, the code is None and the reason is an empty string.
"""
if self.payload:
code = struct.unpack('!H', str(self.payload[:2]))
code = struct.unpack('!H', str(self.payload[:2]))[0]
reason = str(self.payload[2:])
else:
code = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment