]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Pull from websockify. Fix close code.
authorJoel Martin <github@martintribe.org>
Fri, 11 May 2012 03:10:01 +0000 (22:10 -0500)
committerJoel Martin <github@martintribe.org>
Fri, 11 May 2012 03:10:01 +0000 (22:10 -0500)
utils/websocket.py

index 71400285c3eb560d334479ea08f7d1aed682953d..d3bb48cbf8cc1fc4bd3a0c016a25f7ae084fea2d 100644 (file)
@@ -362,7 +362,7 @@ Sec-WebSocket-Accept: %s\r
 
         if f['opcode'] == 0x08:
             if f['length'] >= 2:
-                f['close_code'] = unpack_from(">H", f['payload'])
+                f['close_code'] = unpack_from(">H", f['payload'])[0]
             if f['length'] > 3:
                 f['close_reason'] = f['payload'][2:]
 
@@ -769,8 +769,6 @@ Sec-WebSocket-Accept: %s\r
                 # Close the client
                 _, exc, _ = sys.exc_info()
                 if self.client:
-                    print exc
-                    print repr(exc.args)
                     self.send_close(exc.args[0], exc.args[1])
             except self.EClose:
                 _, exc, _ = sys.exc_info()