@@ -110,7 +110,7 @@ class ABNF(object):
|
|||||||
raise WebSocketProtocolException("rsv is not implemented, yet")
|
raise WebSocketProtocolException("rsv is not implemented, yet")
|
||||||
|
|
||||||
if self.opcode not in ABNF.OPCODES:
|
if self.opcode not in ABNF.OPCODES:
|
||||||
raise WebSocketProtocolException("Invalid opcode " + self.opcode)
|
raise WebSocketProtocolException("Invalid opcode " + str(self.opcode))
|
||||||
|
|
||||||
if self.opcode == ABNF.OPCODE_PING and not self.fin:
|
if self.opcode == ABNF.OPCODE_PING and not self.fin:
|
||||||
raise WebSocketProtocolException("Invalid ping frame.")
|
raise WebSocketProtocolException("Invalid ping frame.")
|
||||||
|
@@ -944,7 +944,8 @@ class WebSocket(object):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
if not bytes:
|
if not bytes:
|
||||||
self.sock.close()
|
if self.sock:
|
||||||
|
self.sock.close()
|
||||||
self.sock = None
|
self.sock = None
|
||||||
self.connected = False
|
self.connected = False
|
||||||
raise WebSocketConnectionClosedException()
|
raise WebSocketConnectionClosedException()
|
||||||
|
Reference in New Issue
Block a user