Commit 46c3b42c authored by Taddeüs Kroes's avatar Taddeüs Kroes

Code cleanup

parent 7c99e4fe
import zlib import zlib
from frame import ControlFrame
from errors import SocketClosed
from extension import Extension from extension import Extension
from frame import ControlFrame
class DeflateFrame(Extension): class DeflateFrame(Extension):
...@@ -21,7 +20,6 @@ class DeflateFrame(Extension): ...@@ -21,7 +20,6 @@ class DeflateFrame(Extension):
name = 'deflate-frame' name = 'deflate-frame'
rsv1 = True rsv1 = True
# FIXME: is 32768 (below) correct?
defaults = {'max_window_bits': 15, 'no_context_takeover': False} defaults = {'max_window_bits': 15, 'no_context_takeover': False}
def __init__(self, defaults={}, request={}): def __init__(self, defaults={}, request={}):
...@@ -60,7 +58,7 @@ class DeflateFrame(Extension): ...@@ -60,7 +58,7 @@ class DeflateFrame(Extension):
def recv(self, frame): def recv(self, frame):
if frame.rsv1: if frame.rsv1:
if isinstance(frame, ControlFrame): if isinstance(frame, ControlFrame):
raise SocketClosed('received compressed control frame') raise ValueError('received compressed control frame')
frame.rsv1 = False frame.rsv1 = False
frame.payload = self.inflate(frame.payload) frame.payload = self.inflate(frame.payload)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment