Lawouach/WebSocket-for-Python — Issue #14: Bad code for binary send in client/__init__.py ??
Author: dbrnz
Created: 2011-12-12 23:28:10+00:00
State: open

Something doesn't look right at the end of client/__init__.py. Isl the following correct? Thanks.

diff --git a/ws4py/client/__init__.py b/ws4py/client/__init__.py
index fd6a155..61ed2a3 100644
--- a/ws4py/client/__init__.py
+++ b/ws4py/client/__init__.py
@@ -137,10 +137,10 @@ class WebSocketBaseClient(object):
if not binary:
self.write_to_connection(self.stream.text_message(bytes).fragment(first=first, mask=True))
else:
- self.write_to_connection(self.stream.binary_message(payload).fragment(first=first, mask=True))
+ self.write_to_connection(self.stream.binary_message(bytes).fragment(first=first, mask=True))
bytes = chunk
first = False
if not binary:
self.write_to_connection(self.stream.text_message(bytes).fragment(last=True, mask=True))
else:
- self.write_to_connection(self.stream.text_message(bytes).fragment(last=True, mask=True))
+ self.write_to_connection(self.stream.binary_message(bytes).fragment(last=True, mask=True))