]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Pull websockify: python3 numpy buffer/string fix.
authorJoel Martin <github@martintribe.org>
Sat, 10 Sep 2011 21:03:39 +0000 (16:03 -0500)
committerJoel Martin <github@martintribe.org>
Sat, 10 Sep 2011 21:03:39 +0000 (16:03 -0500)
Pull from websockify 1c39c7f1f001.

utils/websocket.py

index e906b7e0543ce878e8589af097789bcf91476449..8194914ae3ccdf11360c886b22c301ff78458368 100644 (file)
@@ -295,7 +295,7 @@ Sec-WebSocket-Accept: %s\r
         if has_mask:
             # unmask payload
             f['mask'] = buf[f['hlen']:f['hlen']+4]
-            b = c = ''
+            b = c = s2b('')
             if f['length'] >= 4:
                 mask = numpy.frombuffer(buf, dtype=numpy.dtype('<u4'),
                         offset=f['hlen'], count=1)
@@ -635,7 +635,7 @@ Sec-WebSocket-Accept: %s\r
             # Generate the hash value for the accept header
             accept = b64encode(sha1(s2b(key + self.GUID)).digest())
 
-            response = self.server_handshake_hybi % accept
+            response = self.server_handshake_hybi % b2s(accept)
             if self.base64:
                 response += "Sec-WebSocket-Protocol: base64\r\n"
             else: