Patchwork [16,of,18] configitems: register the 'badserver.closeafterrecvbytes' config

login
register
mail settings
Submitter Pierre-Yves David
Date July 2, 2017, 2:57 a.m.
Message ID <b060d6509d32efeeb4c2.1498964264@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21908/
State Accepted
Headers show

Comments

Pierre-Yves David - July 2, 2017, 2:57 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1498786064 -7200
#      Fri Jun 30 03:27:44 2017 +0200
# Node ID b060d6509d32efeeb4c21e70687b751ae1c7c459
# Parent  56a2d68c1eb6081ebbd0df068405e2570c6c5a2e
# EXP-Topic config.register.badserver
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r b060d6509d32
configitems: register the 'badserver.closeafterrecvbytes' config

Patch

diff --git a/tests/badserverext.py b/tests/badserverext.py
--- a/tests/badserverext.py
+++ b/tests/badserverext.py
@@ -47,6 +47,9 @@  configitem = registrar.configitem(config
 configitem('badserver', 'closeafteraccept',
     default=False,
 )
+configitem('badserver', 'closeafterrecvbytes',
+    default=0,
+)
 
 # We can't adjust __class__ on a socket instance. So we define a proxy type.
 class socketproxy(object):
@@ -267,7 +270,7 @@  def extsetup(ui):
         def process_request(self, socket, address):
             # Wrap socket in a proxy if we need to count bytes.
             closeafterrecvbytes = self._ui.configint('badserver',
-                                                     'closeafterrecvbytes', 0)
+                                                     'closeafterrecvbytes')
             closeaftersendbytes = self._ui.configint('badserver',
                                                      'closeaftersendbytes', 0)