xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #2121: websockify.patch

File websockify.patch, 1.7 KB (added by Antoine Martin, 3 years ago)

bugs in websockify trunk

  • websockify/websocket.py

    diff --git a/websockify/websocket.py b/websockify/websocket.py
    index 3ea0328..c5db3bc 100644
    a b class WebSocket(object): 
    463463
    464464        The how argument is currently ignored.
    465465        """
     466        print("shutdown(%s, %i, %s)" % (how, code, reason))
    466467
    467468        # Already closing?
    468469        if self._sent_close:
    class WebSocket(object): 
    478479
    479480        msg = ''.encode('ascii')
    480481        if code is not None:
     482            print("code=%s (%s)" % (code, type(code)))
    481483            msg += struct.pack(">H", code)
    482484            if reason is not None:
    483485                msg += reason.encode("UTF-8")
    class WebSocket(object): 
    599601                code = None
    600602                reason = None
    601603                if len(frame["payload"]) >= 2:
    602                     code = struct.unpack(">H", frame["payload"][:2])
     604                    code = struct.unpack(">H", frame["payload"][:2])[0]
    603605                    if len(frame["payload"]) > 2:
    604606                        reason = frame["payload"][2:]
    605607                        try:
    class WebSocket(object): 
    609611                            continue
    610612
    611613                if code is None:
    612                     self.close_code = 1005
     614                    self.close_code = code = 1005
    613615                    self.close_reason = "No close status code specified by peer"
    614616                else:
    615617                    self.close_code = code
    616618                    if reason is not None:
    617619                        self.close_reason = reason
    618620
    619                 self.shutdown(code, reason)
     621                self.shutdown(None, code, reason)
    620622                return None
    621623            elif frame["opcode"] == 0x9:
    622624                if not frame["fin"]: