[PATCH] chgserver: explicitly set blocking on client socket

Jun Wu quark at fb.com
Wed Mar 9 18:58:12 EST 2016


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1457567852 0
#      Wed Mar 09 23:57:32 2016 +0000
# Node ID 9a176f60278dd6cd43a8f1a3940d410da2eed731
# Parent  b0ed6e1cf51a6c44c5323a35622bea0e35fd0b0d
chgserver: explicitly set blocking on client socket

hgcia.py uses socket.setdefaulttimeout and it will make every new socket object
behave differently. This patch explicitly set client socket to be blocking
without a timeout and makes it possible for chg to pass test-hgcia.t

diff --git a/hgext/chgserver.py b/hgext/chgserver.py
--- a/hgext/chgserver.py
+++ b/hgext/chgserver.py
@@ -341,6 +341,7 @@
         super(chgcmdserver, self).__init__(
             _newchgui(ui, channeledsystem(fin, fout, 'S')), repo, fin, fout)
         self.clientsock = sock
+        sock.setblocking(1)
         self._oldios = []  # original (self.ch, ui.fp, fd) before "attachio"
         self.hashstate = hashstate
         self.baseaddress = baseaddress


More information about the Mercurial-devel mailing list