xpra icon
Bug tracker and wiki

Ticket #1298: proxy-fixes.patch

File proxy-fixes.patch, 4.0 KB (added by Antoine Martin, 3 years ago)

back to a timeout - this at least seems to work everywhere?

  • html5/js/Client.js

     
    16391639        var datasize = packet[5];
    16401640        var data = packet[6];
    16411641
    1642         if(mimetype != "application/pdf") {
    1643                 this.warn("Received unsupported print data: "+mimetype);
    1644         } else if (!printit) {
    1645                 this.warn("Received non printed file data");
     1642        if (!printit) {
     1643                ctx.warn("Received non printed file data");
     1644        }
     1645        else if(mimetype != "application/pdf") {
     1646                ctx.warn("Received unsupported print data mimetype: "+mimetype);
    16461647        } else {
    16471648                // check the data size for file
    16481649                if(data.length != datasize) {
    1649                         this.warn("send-file: invalid data size, received", data.length, "bytes, expected", datasize);
     1650                        ctx.warn("send-file: invalid data size, received", data.length, "bytes, expected", datasize);
    16501651                } else {
    1651                         this.log("got some data to print");
     1652                        ctx.log("got some data to print");
    16521653                        var b64data = btoa(uintToString(data));
    16531654                        window.open(
    16541655                                        'data:application/pdf;base64,'+b64data,
  • xpra/server/proxy/proxy_instance_process.py

     
    615615        elif packet_type=="window-icon":
    616616            self._packet_recompress(packet, 5, "icon")
    617617        elif packet_type=="send-file":
    618             if packet[6]:
    619                 packet[6] = Compressed("file-data", packet[6])
     618            pass
    620619        elif packet_type=="send-file-chunk":
    621             if packet[3]:
    622                 packet[3] = Compressed("file-chunk-data", packet[3])
     620            pass
    623621        elif packet_type=="challenge":
    624622            from xpra.net.crypto import get_salt
    625623            #client may have already responded to the challenge,
  • xpra/server/proxy/proxy_server.py

     
    3333
    3434
    3535PROXY_SOCKET_TIMEOUT = float(os.environ.get("XPRA_PROXY_SOCKET_TIMEOUT", "0.1"))
    36 PROXY_WS_TIMEOUT = float(os.environ.get("XPRA_PROXY_WS_TIMEOUT", "0.0"))
     36PROXY_WS_TIMEOUT = float(os.environ.get("XPRA_PROXY_WS_TIMEOUT", "1.0"))
    3737assert PROXY_SOCKET_TIMEOUT>0, "invalid proxy socket timeout"
    3838
    3939
     
    201201            authlog.error(" %s", e)
    202202            disconnect(AUTHENTICATION_ERROR, "cannot access sessions")
    203203            return
     204        authlog("start_proxy(%s, {..}, %s) found sessions: %s", client_proto, auth_caps, sessions)
    204205        if sessions is None:
    205206            disconnect(SESSION_NOT_FOUND, "no sessions found")
    206207            return
    207         authlog("start_proxy(%s, {..}, %s) found sessions: %s", client_proto, auth_caps, sessions)
    208208        uid, gid, displays, env_options, session_options = sessions
    209209        if os.name=="posix":
    210210            if uid==0 or gid==0:
     
    230230        display = None
    231231        proc = None
    232232        sns = c.dictget("start-new-session")
     233        authlog("start_proxy: displays=%s, start-new-session=%s", displays, bool(sns))
    233234        if len(displays)==0 or sns:
    234235            if self._start_sessions:
    235236                #start a new session
  • xpra/server/server_core.py

     
    714714        from xpra.net.websocket import WebSocketConnection, WSRequestHandler
    715715        try:
    716716            sock = conn._socket
     717            sock.setblocking(False)
    717718            sock.settimeout(self._ws_timeout)
    718             if os.name=="posix":
    719                 sock.setblocking(True)
    720719            def new_websocket_client(wsh):
    721720                wslog("new_websocket_client(%s) socket=%s", wsh, sock)
    722721                wsc = WebSocketConnection(sock, conn.local, conn.remote, conn.target, conn.socktype, wsh)