Show More
@@ -5,7 +5,7 b'' | |||
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 |
import cgi, cStringIO |
|
|
8 | import cgi, cStringIO, zlib, sys, urllib | |
|
9 | 9 | from mercurial import util, wireproto |
|
10 | 10 | from common import HTTP_OK |
|
11 | 11 | |
@@ -32,11 +32,13 b' class webproto(object):' | |||
|
32 | 32 | def _args(self): |
|
33 | 33 | args = self.req.form.copy() |
|
34 | 34 | chunks = [] |
|
35 | for i in itertools.count(1): | |
|
36 | h = self.req.env.get('HTTP_X_ARG_' + str(i)) | |
|
35 | i = 1 | |
|
36 | while 1: | |
|
37 | h = self.req.env.get('HTTP_X_HGARG_' + str(i)) | |
|
37 | 38 | if h is None: |
|
38 | 39 | break |
|
39 | 40 | chunks += [h] |
|
41 | i += 1 | |
|
40 | 42 | args.update(cgi.parse_qs(''.join(chunks), keep_blank_values=True)) |
|
41 | 43 | return args |
|
42 | 44 | def getfile(self, fp): |
@@ -85,7 +85,7 b' class httprepository(wireproto.wirerepos' | |||
|
85 | 85 | if headersize > 0: |
|
86 | 86 | # The headers can typically carry more data than the URL. |
|
87 | 87 | encargs = urllib.urlencode(sorted(args.items())) |
|
88 | headerfmt = 'X-Arg-%s' | |
|
88 | headerfmt = 'X-HgArg-%s' | |
|
89 | 89 | contentlen = headersize - len(headerfmt % '000' + ': \r\n') |
|
90 | 90 | headernum = 0 |
|
91 | 91 | for i in xrange(0, len(encargs), contentlen): |
@@ -247,7 +247,7 b' Verify we hit the HTTP server:' | |||
|
247 | 247 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
248 | 248 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - (glob) |
|
249 | 249 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
250 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-arg-1:common=c1818a9f5977dd4139a48f93f5425c67d44a9368+ea919464b16e003894c48b6cb68df3cd9411b544&heads=6b57ee934bb2996050540f84cdfc8dcad1e7267d+2114148793524fd045998f71a45b0aaf139f752b (glob) | |
|
250 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=c1818a9f5977dd4139a48f93f5425c67d44a9368+ea919464b16e003894c48b6cb68df3cd9411b544&heads=6b57ee934bb2996050540f84cdfc8dcad1e7267d+2114148793524fd045998f71a45b0aaf139f752b (glob) | |
|
251 | 251 | |
|
252 | 252 | $ cat error.log |
|
253 | 253 |
@@ -100,21 +100,21 b' do not use the proxy if it is in the no ' | |||
|
100 | 100 | $ cat proxy.log |
|
101 | 101 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
102 | 102 | * - - [*] "GET http://localhost:$HGPORT/?cmd=stream_out HTTP/1.1" - - (glob) |
|
103 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-arg-1:namespace=bookmarks (glob) | |
|
103 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) | |
|
104 | 104 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
105 | 105 | * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob) |
|
106 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-arg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) | |
|
107 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-arg-1:namespace=bookmarks (glob) | |
|
106 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) | |
|
107 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) | |
|
108 | 108 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
109 | 109 | * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob) |
|
110 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-arg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) | |
|
111 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-arg-1:namespace=bookmarks (glob) | |
|
110 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) | |
|
111 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) | |
|
112 | 112 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
113 | 113 | * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob) |
|
114 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-arg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) | |
|
115 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-arg-1:namespace=bookmarks (glob) | |
|
114 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) | |
|
115 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) | |
|
116 | 116 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
117 | 117 | * - - [*] "GET http://localhost:$HGPORT/?cmd=heads HTTP/1.1" - - (glob) |
|
118 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-arg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) | |
|
119 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-arg-1:namespace=bookmarks (glob) | |
|
118 | * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629 (glob) | |
|
119 | * - - [*] "GET http://localhost:$HGPORT/?cmd=listkeys HTTP/1.1" - - x-hgarg-1:namespace=bookmarks (glob) | |
|
120 | 120 |
@@ -28,4 +28,4 b' Ensure hashed heads format is used.' | |||
|
28 | 28 | The hash here is always the same since the remote repository only has the null head. |
|
29 | 29 | |
|
30 | 30 | $ cat access.log | grep unbundle |
|
31 | * - - [*] "POST /?cmd=unbundle HTTP/1.1" 200 - x-arg-1:heads=686173686564+6768033e216468247bd031a0a2d9876d79818f8f (glob) | |
|
31 | * - - [*] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+6768033e216468247bd031a0a2d9876d79818f8f (glob) |
@@ -36,23 +36,23 b' HTTP:' | |||
|
36 | 36 | $ cat error.log |
|
37 | 37 | $ cat access.log |
|
38 | 38 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
39 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-arg-1:four=quatre&one=un&three=trois&two=deux (glob) | |
|
40 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-arg-1:four=quatre&one=un&three=trois&two=deux (glob) | |
|
39 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=quatre&one=un&three=trois&two=deux (glob) | |
|
40 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=quatre&one=un&three=trois&two=deux (glob) | |
|
41 | 41 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
42 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-arg-1:four=qu++atre&one=+un&three=trois+&two=deux (glob) | |
|
43 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-arg-1:four=qu++atre&one=+un&three=trois+&two=deux (glob) | |
|
42 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=qu++atre&one=+un&three=trois+&two=deux (glob) | |
|
43 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=qu++atre&one=+un&three=trois+&two=deux (glob) | |
|
44 | 44 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
45 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-arg-1:four=vier&one=eins&two=zwei (glob) | |
|
46 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-arg-1:four=vier&one=eins&two=zwei (glob) | |
|
45 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=vier&one=eins&two=zwei (glob) | |
|
46 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:four=vier&one=eins&two=zwei (glob) | |
|
47 | 47 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
48 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-arg-1:one=eins&two=zwei (glob) | |
|
49 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-arg-1:one=eins&two=zwei (glob) | |
|
48 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei (glob) | |
|
49 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei (glob) | |
|
50 | 50 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
51 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-arg-1:one=eins&two=zwei (glob) | |
|
52 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-arg-1:one=eins&two=zwei (glob) | |
|
51 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei (glob) | |
|
52 | * - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-hgarg-1:one=eins&two=zwei (glob) | |
|
53 | 53 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
54 |
* - - [*] "GET /?cmd=debugwireargs HTTP/1.1" 200 - x-arg-1:four=onethousandcharactersxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&one x-hgarg-2:=un&three=trois&two=deux (glob) | |
|
56 | 56 | |
|
57 | 57 | HTTP without the httpheader capability: |
|
58 | 58 |
General Comments 0
You need to be logged in to leave comments.
Login now