tiny refactoring.

This commit is contained in:
Hiroki Ohtani
2014-12-22 10:14:33 +09:00
parent a58b94d826
commit fc9325da88

View File

@@ -638,12 +638,13 @@ class WebSocket(object):
while True:
line = self._recv_line()
line = line.decode('utf-8')
if line == "\r\n" or line == "\n":
line = line.decode('utf-8').strip()
if not line:
break
line = line.strip()
if traceEnabled:
logger.debug(line)
if not status:
status_info = line.split(" ", 2)
status = int(status_info[1])