Commits

Jeffrey Gelens committed c8aeb96

Fixed error on sudden connection close

  • Participants
  • Parent commits 94d2dea
  • Branches default

Comments (0)

Files changed (1)

geventwebsocket/websocket.py

                 return None
 
             frame_str = self.rfile.read(1)
-            frame_type = ord(frame_str)
+            if not frame_str:
+                # Connection lost?
+                self.websocket_closed = True
+                continue
+            else:
+                frame_type = ord(frame_str)
+
+
             if (frame_type & 0x80) == 0x00: # most significant byte is not set
 
                 if frame_type == 0x00: