Show More
@@ -97,24 +97,26 b' class httppeer(wireproto.wirepeer):' | |||||
97 | self.ui.debug("sending %s command\n" % cmd) |
|
97 | self.ui.debug("sending %s command\n" % cmd) | |
98 | q = [('cmd', cmd)] |
|
98 | q = [('cmd', cmd)] | |
99 | headersize = 0 |
|
99 | headersize = 0 | |
100 |
if |
|
100 | if True: | |
101 | httpheader = self.capable('httpheader') |
|
101 | if len(args) > 0: | |
102 | if httpheader: |
|
102 | httpheader = self.capable('httpheader') | |
103 |
|
|
103 | if httpheader: | |
104 | if headersize > 0: |
|
104 | headersize = int(httpheader.split(',', 1)[0]) | |
105 | # The headers can typically carry more data than the URL. |
|
105 | if headersize > 0: | |
106 | encargs = urllib.urlencode(sorted(args.items())) |
|
106 | # The headers can typically carry more data than the URL. | |
107 | headerfmt = 'X-HgArg-%s' |
|
107 | encargs = urllib.urlencode(sorted(args.items())) | |
108 | contentlen = headersize - len(headerfmt % '000' + ': \r\n') |
|
108 | headerfmt = 'X-HgArg-%s' | |
109 | headernum = 0 |
|
109 | contentlen = headersize - len(headerfmt % '000' + ': \r\n') | |
110 | for i in xrange(0, len(encargs), contentlen): |
|
110 | headernum = 0 | |
111 | headernum += 1 |
|
111 | for i in xrange(0, len(encargs), contentlen): | |
112 | header = headerfmt % str(headernum) |
|
112 | headernum += 1 | |
113 | headers[header] = encargs[i:i + contentlen] |
|
113 | header = headerfmt % str(headernum) | |
114 | varyheaders = [headerfmt % str(h) for h in range(1, headernum + 1)] |
|
114 | headers[header] = encargs[i:i + contentlen] | |
115 |
headers |
|
115 | varyheaders = [ | |
116 | else: |
|
116 | headerfmt % str(h) for h in range(1, headernum + 1)] | |
117 | q += sorted(args.items()) |
|
117 | headers['Vary'] = ','.join(varyheaders) | |
|
118 | else: | |||
|
119 | q += sorted(args.items()) | |||
118 | qs = '?%s' % urllib.urlencode(q) |
|
120 | qs = '?%s' % urllib.urlencode(q) | |
119 | cu = "%s%s" % (self._url, qs) |
|
121 | cu = "%s%s" % (self._url, qs) | |
120 | size = 0 |
|
122 | size = 0 |
General Comments 0
You need to be logged in to leave comments.
Login now