Patchwork [09,of,18] configitems: register the 'server.maxhttpheaderlen' config

login
register
mail settings
Submitter Pierre-Yves David
Date July 2, 2017, 10:25 p.m.
Message ID <08d1b1217b40e9c74f06.1499034326@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21933/
State Accepted
Headers show

Comments

Pierre-Yves David - July 2, 2017, 10:25 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1498787051 -7200
#      Fri Jun 30 03:44:11 2017 +0200
# Node ID 08d1b1217b40e9c74f06e958a3dbfada01d65c8d
# Parent  ad4b02828f5f8702d7bd65a0c2b39b7f7a553524
# EXP-Topic config.register.server
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 08d1b1217b40
configitems: register the 'server.maxhttpheaderlen' config

Patch

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -122,6 +122,9 @@  coreconfigitem('server', 'concurrent-pus
 coreconfigitem('server', 'disablefullbundle',
     default=False,
 )
+coreconfigitem('server', 'maxhttpheaderlen',
+    default=1024,
+)
 coreconfigitem('ui', 'clonebundleprefers',
     default=list,
 )
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -771,7 +771,7 @@  def _capabilities(repo, proto):
 
     if proto.name == 'http':
         caps.append('httpheader=%d' %
-                    repo.ui.configint('server', 'maxhttpheaderlen', 1024))
+                    repo.ui.configint('server', 'maxhttpheaderlen'))
         if repo.ui.configbool('experimental', 'httppostargs', False):
             caps.append('httppostargs')