xpra icon
Bug tracker and wiki

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


Ticket #2554: udp-badfix.patch

File udp-badfix.patch, 1.9 KB (added by Antoine Martin, 15 months ago)

this "fixes" things but is not correct

  • xpra/net/udp_protocol.py

     
    182182        packet = ("udp-control", self.mtu, self.asynchronous_receive_enabled,
    183183                  self.last_sequence, self.highest_sequence, missing, tuple(self.cancel))
    184184        log("send_control() packet(%s)=%s", self.pending_packets, ellipsizer(packet))
    185         self._send_async(packet, False, self.send_control_failed)
     185        self._add_packet_to_queue(packet, fail_cb=self.send_control_failed, synchronous=False)
    186186        self.cancel = set()
    187187        self.schedule_control()
    188188        return False
     
    434434            self._read_queue_put(data)
    435435
    436436
    437     def _send_async(self, packet, sync=False, fail_cb=None):
    438         """ used by send_control to bypass the regular queuing functions,
    439             and force enable synchronous=False
    440         """
    441         #log("_send_async(%s, %s) encoder=%s, compressor=%s", packet, sync, self._encoder, self._compress)
    442         log("_send_async(%s, %s)", packet, sync)
    443         chunks = self.encode(packet)
    444         if len(chunks)>1:
    445             return super().send_now(packet)
    446         proto_flags,index,level,data = chunks[0]
    447         from xpra.net.header import pack_header
    448         payload_size = len(data)
    449         header_and_data = pack_header(proto_flags, level, index, payload_size) + data
    450         with self._write_lock:
    451             if self._write_thread is None:
    452                 self.start_write_thread()
    453             self._write_queue.put((header_and_data, None, None, fail_cb, sync))
    454 
    455437    def raw_write(self, items, start_cb=None, end_cb=None, fail_cb=None, synchronous=True, _more=False):
    456438        """ make sure we don't enable asynchronous mode until the other end is read """
    457439        if not self.asynchronous_send_enabled: