فهرست منبع

Fixed issue where server crashes when client closes connection

Stijn 12 سال پیش
والد
کامیت
80538863f6
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      frame.py

+ 1 - 1
frame.py

@@ -185,7 +185,7 @@ class ControlFrame(Frame):
         is given, the code is None and the reason is an empty string.
         is given, the code is None and the reason is an empty string.
         """
         """
         if self.payload:
         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:])
             reason = str(self.payload[2:])
         else:
         else:
             code = None
             code = None