Mercurial > public > mercurial-scm > hg
comparison mercurial/httppeer.py @ 28483:6f38ec428a19
httppeer: do less splitting on httpheader value
We only care about the first value split off, so only split off the first
value.
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 11 Mar 2016 11:24:50 -0500 |
parents | b502138f5faa |
children | da6f713ab480 |
comparison
equal
deleted
inserted
replaced
28482:945e9516b435 | 28483:6f38ec428a19 |
---|---|
110 q = [('cmd', cmd)] | 110 q = [('cmd', cmd)] |
111 headersize = 0 | 111 headersize = 0 |
112 if len(args) > 0: | 112 if len(args) > 0: |
113 httpheader = self.capable('httpheader') | 113 httpheader = self.capable('httpheader') |
114 if httpheader: | 114 if httpheader: |
115 headersize = int(httpheader.split(',')[0]) | 115 headersize = int(httpheader.split(',', 1)[0]) |
116 if headersize > 0: | 116 if headersize > 0: |
117 # The headers can typically carry more data than the URL. | 117 # The headers can typically carry more data than the URL. |
118 encargs = urllib.urlencode(sorted(args.items())) | 118 encargs = urllib.urlencode(sorted(args.items())) |
119 headerfmt = 'X-HgArg-%s' | 119 headerfmt = 'X-HgArg-%s' |
120 contentlen = headersize - len(headerfmt % '000' + ': \r\n') | 120 contentlen = headersize - len(headerfmt % '000' + ': \r\n') |