diff --git a/src/xpra/net/bytestreams.py b/src/xpra/net/bytestreams.py index 6fbd3ccfde..fc8f11e468 100644 --- a/src/xpra/net/bytestreams.py +++ b/src/xpra/net/bytestreams.py @@ -17,7 +17,7 @@ from xpra.platform.features import TCP_OPTIONS, IP_OPTIONS, SOCKET_OPTIONS -SOCKET_NODELAY = envbool("XPRA_SOCKET_NODELAY", True) +SOCKET_NODELAY = envbool("XPRA_SOCKET_NODELAY", None) VSOCK_TIMEOUT = envint("XPRA_VSOCK_TIMEOUT", 5) SOCKET_TIMEOUT = envint("XPRA_SOCKET_TIMEOUT", 20) SSL_PEEK = PYTHON2 and envbool("XPRA_SSL_PEEK", True) @@ -278,9 +278,15 @@ def __init__(self, socket, local, remote, target, socktype, info={}): self.nodelay = None if type(remote)==str: self.filename = remote + if SOCKET_NODELAY is not None: + self.do_set_nodelay(SOCKET_NODELAY) def set_nodelay(self, nodelay): - if self.socktype in ("tcp", "ssl") and self.nodelay!=nodelay: + if SOCKET_NODELAY is None and self.socktype in ("tcp", "ssl") and self.nodelay!=nodelay: + self.do_set_nodelay(nodelay) + + def do_set_nodelay(self, nodelay): + if SOCKET_NODELAY is None and self.socktype in ("tcp", "ssl") and self.nodelay!=nodelay: self._socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, nodelay) self.nodelay = nodelay log("changed %s socket to nodelay=%s", self.socktype, nodelay) diff --git a/src/xpra/net/net_util.py b/src/xpra/net/net_util.py index 0de027c38d..a9b91dc346 100755 --- a/src/xpra/net/net_util.py +++ b/src/xpra/net/net_util.py @@ -303,15 +303,19 @@ def parsenums(v): return net_sys_config def get_net_config(): + config = {} try: from xpra.net.bytestreams import VSOCK_TIMEOUT, SOCKET_TIMEOUT, SOCKET_NODELAY - return { + config = { "vsocket.timeout" : VSOCK_TIMEOUT, "socket.timeout" : SOCKET_TIMEOUT, - "socket.nodelay" : SOCKET_NODELAY, } - except: - return {} + if SOCKET_NODELAY is not None: + config["socket.nodelay"] = SOCKET_NODELAY + except Exception: + log("get_net_config()", exc_info=True) + return config + def get_ssl_info(): try: