Skip to content

Commit

Permalink
Fix #639 by adding close branch for reserved custom status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
engn33r committed Mar 8, 2021
1 parent fd64148 commit df87514
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion websocket/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,9 @@ def close(self, status=STATUS_NORMAL, reason=six.b(""), timeout=3):
continue
if isEnabledForError():
recv_status = struct.unpack("!H", frame.data[0:2])[0]
if recv_status != STATUS_NORMAL:
if recv_status >= 3000 and recv_status <= 4999:
debug("close status: " + repr(recv_status))
elif recv_status != STATUS_NORMAL:
error("close status: " + repr(recv_status))
break
except:
Expand Down

0 comments on commit df87514

Please sign in to comment.