##// END OF EJS Templates
commandserver: move printbanner logic to bindsocket...
Jun Wu -
r32233:1ada3d18 default
parent child Browse files
Show More
@@ -492,6 +492,7 b' class chgunixservicehandler(object):'
492 self._checkextensions()
492 self._checkextensions()
493 self._bind(sock)
493 self._bind(sock)
494 self._createsymlink()
494 self._createsymlink()
495 # no "listening at" message should be printed to simulate hg behavior
495
496
496 def _inithashstate(self, address):
497 def _inithashstate(self, address):
497 self._baseaddress = address
498 self._baseaddress = address
@@ -546,10 +547,6 b' class chgunixservicehandler(object):'
546 # the client will start a new server on demand.
547 # the client will start a new server on demand.
547 util.tryunlink(self._realaddress)
548 util.tryunlink(self._realaddress)
548
549
549 def printbanner(self, address):
550 # no "listening at" message should be printed to simulate hg behavior
551 pass
552
553 def shouldexit(self):
550 def shouldexit(self):
554 if not self._issocketowner():
551 if not self._issocketowner():
555 self.ui.debug('%s is not owned, exiting.\n' % self._realaddress)
552 self.ui.debug('%s is not owned, exiting.\n' % self._realaddress)
@@ -410,14 +410,12 b' class unixservicehandler(object):'
410 def bindsocket(self, sock, address):
410 def bindsocket(self, sock, address):
411 util.bindunixsocket(sock, address)
411 util.bindunixsocket(sock, address)
412 sock.listen(socket.SOMAXCONN)
412 sock.listen(socket.SOMAXCONN)
413 self.ui.status(_('listening at %s\n') % address)
414 self.ui.flush() # avoid buffering of status message
413
415
414 def unlinksocket(self, address):
416 def unlinksocket(self, address):
415 os.unlink(address)
417 os.unlink(address)
416
418
417 def printbanner(self, address):
418 self.ui.status(_('listening at %s\n') % address)
419 self.ui.flush() # avoid buffering of status message
420
421 def shouldexit(self):
419 def shouldexit(self):
422 """True if server should shut down; checked per pollinterval"""
420 """True if server should shut down; checked per pollinterval"""
423 return False
421 return False
@@ -455,7 +453,6 b' class unixforkingservice(object):'
455 self._servicehandler.bindsocket(self._sock, self.address)
453 self._servicehandler.bindsocket(self._sock, self.address)
456 o = signal.signal(signal.SIGCHLD, self._sigchldhandler)
454 o = signal.signal(signal.SIGCHLD, self._sigchldhandler)
457 self._oldsigchldhandler = o
455 self._oldsigchldhandler = o
458 self._servicehandler.printbanner(self.address)
459 self._socketunlinked = False
456 self._socketunlinked = False
460
457
461 def _unlinksocket(self):
458 def _unlinksocket(self):
General Comments 0
You need to be logged in to leave comments. Login now