xpra icon
Bug tracker and wiki

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


Ticket #130: ticket-130.patch

File ticket-130.patch, 1.2 KB (added by Norman Rasmussen, 9 years ago)
  • src/xpra/server.py

    From 938df81bf874045d9bd65d429d34528b704b2a55 Mon Sep 17 00:00:00 2001
    From: Norman Rasmussen <norman@rasmussen.co.za>
    Date: Sat, 26 May 2012 22:40:23 +0100
    Subject: [PATCH] Fix #130, when there are too many connections we need to
     accept and close new connections instead of closing the
     listening socket.
    
    ---
     src/xpra/server.py |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/xpra/server.py b/src/xpra/server.py
    index ce2f10e..4b533d9 100644
    a b class XpraServer(gobject.GObject): 
    10191019        self.disconnect("shutting down")
    10201020
    10211021    def _new_connection(self, listener, *args):
     1022        sock, address = listener.accept()
    10221023        if len(self._potential_protocols)>=MAX_CONCURRENT_CONNECTIONS:
    10231024            log.error("too many connections (%s), ignoring new one", len(self._potential_protocols))
    1024             listener.close()
     1025            sock.close()
    10251026            return  True
    1026         sock, address = listener.accept()
    10271027        log.info("New connection received: %s", sock.getsockname())
    10281028        protocol = Protocol(SocketConnection(sock, address), self.process_packet)
    10291029        self._potential_protocols.append(protocol)