##// END OF EJS Templates
test-http-bad-server: match different in output...
marmoute -
r32320:d3177aec default
parent child Browse files
Show More
@@ -1,905 +1,905
1 1 #require killdaemons serve zstd
2 2
3 3 Client version is embedded in HTTP request and is effectively dynamic. Pin the
4 4 version so behavior is deterministic.
5 5
6 6 $ cat > fakeversion.py << EOF
7 7 > from mercurial import util
8 8 > util.version = lambda: '4.2'
9 9 > EOF
10 10
11 11 $ cat >> $HGRCPATH << EOF
12 12 > [extensions]
13 13 > fakeversion = `pwd`/fakeversion.py
14 14 > EOF
15 15
16 16 $ hg init server0
17 17 $ cd server0
18 18 $ touch foo
19 19 $ hg -q commit -A -m initial
20 20
21 21 Also disable compression because zstd is optional and causes output to vary
22 22 and because debugging partial responses is hard when compression is involved
23 23
24 24 $ cat > .hg/hgrc << EOF
25 25 > [extensions]
26 26 > badserver = $TESTDIR/badserverext.py
27 27 > [server]
28 28 > compressionengines = none
29 29 > EOF
30 30
31 31 Failure to accept() socket should result in connection related error message
32 32
33 33 $ hg --config badserver.closebeforeaccept=true serve -p $HGPORT -d --pid-file=hg.pid
34 34 $ cat hg.pid > $DAEMON_PIDS
35 35
36 36 $ hg clone http://localhost:$HGPORT/ clone
37 37 abort: error: Connection reset by peer (no-windows !)
38 38 abort: error: An existing connection was forcibly closed by the remote host (windows !)
39 39 [255]
40 40
41 41 (The server exits on its own, but there is a race between that and starting a new server.
42 42 So ensure the process is dead.)
43 43
44 44 $ killdaemons.py $DAEMON_PIDS
45 45
46 46 Failure immediately after accept() should yield connection related error message
47 47
48 48 $ hg --config badserver.closeafteraccept=true serve -p $HGPORT -d --pid-file=hg.pid
49 49 $ cat hg.pid > $DAEMON_PIDS
50 50
51 51 TODO: this usually outputs good results, but sometimes emits abort:
52 52 error: '' on FreeBSD and OS X.
53 53 What we ideally want are:
54 54
55 55 abort: error: Connection reset by peer (no-windows !)
56 56 abort: error: An existing connection was forcibly closed by the remote host (windows !)
57 57
58 58 The flakiness in this output was observable easily with
59 59 --runs-per-test=20 on macOS 10.12 during the freeze for 4.2.
60 60 $ hg clone http://localhost:$HGPORT/ clone
61 61 abort: error: * (glob)
62 62 [255]
63 63
64 64 $ killdaemons.py $DAEMON_PIDS
65 65
66 66 Failure to read all bytes in initial HTTP request should yield connection related error message
67 67
68 68 $ hg --config badserver.closeafterrecvbytes=1 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
69 69 $ cat hg.pid > $DAEMON_PIDS
70 70
71 71 TODO this error message is not very good
72 72
73 73 $ hg clone http://localhost:$HGPORT/ clone
74 74 abort: error: ''
75 75 [255]
76 76
77 77 $ killdaemons.py $DAEMON_PIDS
78 78
79 79 $ cat error.log
80 80 readline(1 from 65537) -> (1) G
81 81 read limit reached; closing socket
82 82
83 83 $ rm -f error.log
84 84
85 85 Same failure, but server reads full HTTP request line
86 86
87 87 $ hg --config badserver.closeafterrecvbytes=40 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
88 88 $ cat hg.pid > $DAEMON_PIDS
89 89 $ hg clone http://localhost:$HGPORT/ clone
90 90 abort: error: ''
91 91 [255]
92 92
93 93 $ killdaemons.py $DAEMON_PIDS
94 94
95 95 $ cat error.log
96 96 readline(40 from 65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
97 97 readline(7 from -1) -> (7) Accept-
98 98 read limit reached; closing socket
99 99
100 100 $ rm -f error.log
101 101
102 102 Failure on subsequent HTTP request on the same socket (cmd?batch)
103 103
104 104 $ hg --config badserver.closeafterrecvbytes=210 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
105 105 $ cat hg.pid > $DAEMON_PIDS
106 106 $ hg clone http://localhost:$HGPORT/ clone
107 107 abort: error: ''
108 108 [255]
109 109
110 110 $ killdaemons.py $DAEMON_PIDS
111 111
112 112 $ cat error.log
113 113 readline(210 from 65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
114 114 readline(177 from -1) -> (27) Accept-Encoding: identity\r\n
115 115 readline(150 from -1) -> (35) accept: application/mercurial-0.1\r\n
116 116 readline(115 from -1) -> (2?) host: localhost:$HGPORT\r\n (glob)
117 117 readline(9? from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
118 118 readline(4? from -1) -> (2) \r\n (glob)
119 119 write(36) -> HTTP/1.1 200 Script output follows\r\n
120 120 write(23) -> Server: badhttpserver\r\n
121 121 write(37) -> Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
122 122 write(41) -> Content-Type: application/mercurial-0.1\r\n
123 123 write(21) -> Content-Length: 405\r\n
124 124 write(2) -> \r\n
125 125 write(405) -> lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
126 readline(41 from 65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
126 readline(4? from 65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob)
127 127 readline(1? from -1) -> (1?) Accept-Encoding* (glob)
128 128 read limit reached; closing socket
129 129 readline(210 from 65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
130 130 readline(184 from -1) -> (27) Accept-Encoding: identity\r\n
131 131 readline(157 from -1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
132 132 readline(128 from -1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
133 133 readline(87 from -1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
134 134 readline(39 from -1) -> (35) accept: application/mercurial-0.1\r\n
135 135 readline(4 from -1) -> (4) host
136 136 read limit reached; closing socket
137 137
138 138 $ rm -f error.log
139 139
140 140 Failure to read getbundle HTTP request
141 141
142 142 $ hg --config badserver.closeafterrecvbytes=292 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
143 143 $ cat hg.pid > $DAEMON_PIDS
144 144 $ hg clone http://localhost:$HGPORT/ clone
145 145 requesting all changes
146 146 abort: error: ''
147 147 [255]
148 148
149 149 $ killdaemons.py $DAEMON_PIDS
150 150
151 151 $ cat error.log
152 152 readline(292 from 65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
153 153 readline(259 from -1) -> (27) Accept-Encoding: identity\r\n
154 154 readline(232 from -1) -> (35) accept: application/mercurial-0.1\r\n
155 155 readline(197 from -1) -> (2?) host: localhost:$HGPORT\r\n (glob)
156 156 readline(17? from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
157 157 readline(12? from -1) -> (2) \r\n (glob)
158 158 write(36) -> HTTP/1.1 200 Script output follows\r\n
159 159 write(23) -> Server: badhttpserver\r\n
160 160 write(37) -> Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
161 161 write(41) -> Content-Type: application/mercurial-0.1\r\n
162 162 write(21) -> Content-Length: 405\r\n
163 163 write(2) -> \r\n
164 164 write(405) -> lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
165 165 readline\(12[34] from 65537\) -> \(2[67]\) GET /\?cmd=batch HTTP/1.1\\r\\n (re)
166 166 readline(9? from -1) -> (27) Accept-Encoding: identity\r\n (glob)
167 167 readline(7? from -1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
168 168 readline(4? from -1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
169 169 readline(1 from -1) -> (1) x (?)
170 170 read limit reached; closing socket
171 171 readline(292 from 65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
172 172 readline(266 from -1) -> (27) Accept-Encoding: identity\r\n
173 173 readline(239 from -1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
174 174 readline(210 from -1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
175 175 readline(169 from -1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
176 176 readline(121 from -1) -> (35) accept: application/mercurial-0.1\r\n
177 177 readline(86 from -1) -> (2?) host: localhost:$HGPORT\r\n (glob)
178 178 readline(6? from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
179 179 readline(1? from -1) -> (2) \r\n (glob)
180 180 write(36) -> HTTP/1.1 200 Script output follows\r\n
181 181 write(23) -> Server: badhttpserver\r\n
182 182 write(37) -> Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
183 183 write(41) -> Content-Type: application/mercurial-0.1\r\n
184 184 write(20) -> Content-Length: 42\r\n
185 185 write(2) -> \r\n
186 186 write(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
187 187 readline\(1[23] from 65537\) -> \(1[23]\) GET /\?cmd=ge.? (re)
188 188 read limit reached; closing socket
189 189 readline(292 from 65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
190 190 readline(262 from -1) -> (27) Accept-Encoding: identity\r\n
191 191 readline(235 from -1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
192 192 readline(206 from -1) -> (206) x-hgarg-1: bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Ali
193 193 read limit reached; closing socket
194 194
195 195 $ rm -f error.log
196 196
197 197 Now do a variation using POST to send arguments
198 198
199 199 $ hg --config experimental.httppostargs=true --config badserver.closeafterrecvbytes=315 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
200 200 $ cat hg.pid > $DAEMON_PIDS
201 201
202 202 $ hg clone http://localhost:$HGPORT/ clone
203 203 abort: error: ''
204 204 [255]
205 205
206 206 $ killdaemons.py $DAEMON_PIDS
207 207
208 208 $ cat error.log
209 209 readline(315 from 65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
210 210 readline(282 from -1) -> (27) Accept-Encoding: identity\r\n
211 211 readline(255 from -1) -> (35) accept: application/mercurial-0.1\r\n
212 212 readline(220 from -1) -> (2?) host: localhost:$HGPORT\r\n (glob)
213 213 readline(19? from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
214 214 readline(14? from -1) -> (2) \r\n (glob)
215 215 write(36) -> HTTP/1.1 200 Script output follows\r\n
216 216 write(23) -> Server: badhttpserver\r\n
217 217 write(37) -> Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
218 218 write(41) -> Content-Type: application/mercurial-0.1\r\n
219 219 write(21) -> Content-Length: 418\r\n
220 220 write(2) -> \r\n
221 221 write(418) -> lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httppostargs httpmediatype=0.1rx,0.1tx,0.2tx compression=none
222 222 readline\(14[67] from 65537\) -> \(2[67]\) POST /\?cmd=batch HTTP/1.1\\r\\n (re)
223 223 readline\(1(19|20) from -1\) -> \(27\) Accept-Encoding: identity\\r\\n (re)
224 224 readline(9? from -1) -> (41) content-type: application/mercurial-0.1\r\n (glob)
225 225 readline(5? from -1) -> (19) vary: X-HgProto-1\r\n (glob)
226 226 readline(3? from -1) -> (19) x-hgargs-post: 28\r\n (glob)
227 227 readline(1? from -1) -> (1?) x-hgproto-1: * (glob)
228 228 read limit reached; closing socket
229 229 readline(315 from 65537) -> (27) POST /?cmd=batch HTTP/1.1\r\n
230 230 readline(288 from -1) -> (27) Accept-Encoding: identity\r\n
231 231 readline(261 from -1) -> (41) content-type: application/mercurial-0.1\r\n
232 232 readline(220 from -1) -> (19) vary: X-HgProto-1\r\n
233 233 readline(201 from -1) -> (19) x-hgargs-post: 28\r\n
234 234 readline(182 from -1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
235 235 readline(134 from -1) -> (35) accept: application/mercurial-0.1\r\n
236 236 readline(99 from -1) -> (20) content-length: 28\r\n
237 237 readline(79 from -1) -> (2?) host: localhost:$HGPORT\r\n (glob)
238 238 readline(5? from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
239 239 readline(? from -1) -> (2) \r\n (glob)
240 240 read(? from 28) -> (?) cmds=* (glob)
241 241 read limit reached, closing socket
242 242 write(36) -> HTTP/1.1 500 Internal Server Error\r\n
243 243
244 244 $ rm -f error.log
245 245
246 246 Now move on to partial server responses
247 247
248 248 Server sends a single character from the HTTP response line
249 249
250 250 $ hg --config badserver.closeaftersendbytes=1 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
251 251 $ cat hg.pid > $DAEMON_PIDS
252 252
253 253 $ hg clone http://localhost:$HGPORT/ clone
254 254 abort: error: H
255 255 [255]
256 256
257 257 $ killdaemons.py $DAEMON_PIDS
258 258
259 259 $ cat error.log
260 260 readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
261 261 readline(-1) -> (27) Accept-Encoding: identity\r\n
262 262 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
263 263 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
264 264 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
265 265 readline(-1) -> (2) \r\n
266 266 write(1 from 36) -> (0) H
267 267 write limit reached; closing socket
268 268 write(36) -> HTTP/1.1 500 Internal Server Error\r\n
269 269
270 270 $ rm -f error.log
271 271
272 272 Server sends an incomplete capabilities response body
273 273
274 274 $ hg --config badserver.closeaftersendbytes=180 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
275 275 $ cat hg.pid > $DAEMON_PIDS
276 276
277 277 $ hg clone http://localhost:$HGPORT/ clone
278 278 abort: HTTP request error (incomplete response; expected 385 bytes got 20)
279 279 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
280 280 [255]
281 281
282 282 $ killdaemons.py $DAEMON_PIDS
283 283
284 284 $ cat error.log
285 285 readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
286 286 readline(-1) -> (27) Accept-Encoding: identity\r\n
287 287 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
288 288 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
289 289 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
290 290 readline(-1) -> (2) \r\n
291 291 write(36 from 36) -> (144) HTTP/1.1 200 Script output follows\r\n
292 292 write(23 from 23) -> (121) Server: badhttpserver\r\n
293 293 write(37 from 37) -> (84) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
294 294 write(41 from 41) -> (43) Content-Type: application/mercurial-0.1\r\n
295 295 write(21 from 21) -> (22) Content-Length: 405\r\n
296 296 write(2 from 2) -> (20) \r\n
297 297 write(20 from 405) -> (0) lookup changegroupsu
298 298 write limit reached; closing socket
299 299
300 300 $ rm -f error.log
301 301
302 302 Server sends incomplete headers for batch request
303 303
304 304 $ hg --config badserver.closeaftersendbytes=695 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
305 305 $ cat hg.pid > $DAEMON_PIDS
306 306
307 307 TODO this output is horrible
308 308
309 309 $ hg clone http://localhost:$HGPORT/ clone
310 310 abort: 'http://localhost:$HGPORT/' does not appear to be an hg repository:
311 311 ---%<--- (application/mercuria)
312 312
313 313 ---%<---
314 314 !
315 315 [255]
316 316
317 317 $ killdaemons.py $DAEMON_PIDS
318 318
319 319 $ cat error.log
320 320 readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
321 321 readline(-1) -> (27) Accept-Encoding: identity\r\n
322 322 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
323 323 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
324 324 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
325 325 readline(-1) -> (2) \r\n
326 326 write(36 from 36) -> (659) HTTP/1.1 200 Script output follows\r\n
327 327 write(23 from 23) -> (636) Server: badhttpserver\r\n
328 328 write(37 from 37) -> (599) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
329 329 write(41 from 41) -> (558) Content-Type: application/mercurial-0.1\r\n
330 330 write(21 from 21) -> (537) Content-Length: 405\r\n
331 331 write(2 from 2) -> (535) \r\n
332 332 write(405 from 405) -> (130) lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
333 333 readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
334 334 readline(-1) -> (27) Accept-Encoding: identity\r\n
335 335 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
336 336 readline(-1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
337 337 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
338 338 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
339 339 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
340 340 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
341 341 readline(-1) -> (2) \r\n
342 342 write(36 from 36) -> (94) HTTP/1.1 200 Script output follows\r\n
343 343 write(23 from 23) -> (71) Server: badhttpserver\r\n
344 344 write(37 from 37) -> (34) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
345 345 write(34 from 41) -> (0) Content-Type: application/mercuria
346 346 write limit reached; closing socket
347 347 write(36) -> HTTP/1.1 500 Internal Server Error\r\n
348 348
349 349 $ rm -f error.log
350 350
351 351 Server sends an incomplete HTTP response body to batch request
352 352
353 353 $ hg --config badserver.closeaftersendbytes=760 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
354 354 $ cat hg.pid > $DAEMON_PIDS
355 355
356 356 TODO client spews a stack due to uncaught ValueError in batch.results()
357 357 $ hg clone http://localhost:$HGPORT/ clone 2> /dev/null
358 358 [1]
359 359
360 360 $ killdaemons.py $DAEMON_PIDS
361 361
362 362 $ cat error.log
363 363 readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
364 364 readline(-1) -> (27) Accept-Encoding: identity\r\n
365 365 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
366 366 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
367 367 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
368 368 readline(-1) -> (2) \r\n
369 369 write(36 from 36) -> (724) HTTP/1.1 200 Script output follows\r\n
370 370 write(23 from 23) -> (701) Server: badhttpserver\r\n
371 371 write(37 from 37) -> (664) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
372 372 write(41 from 41) -> (623) Content-Type: application/mercurial-0.1\r\n
373 373 write(21 from 21) -> (602) Content-Length: 405\r\n
374 374 write(2 from 2) -> (600) \r\n
375 375 write(405 from 405) -> (195) lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
376 376 readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
377 377 readline(-1) -> (27) Accept-Encoding: identity\r\n
378 378 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
379 379 readline(-1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
380 380 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
381 381 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
382 382 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
383 383 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
384 384 readline(-1) -> (2) \r\n
385 385 write(36 from 36) -> (159) HTTP/1.1 200 Script output follows\r\n
386 386 write(23 from 23) -> (136) Server: badhttpserver\r\n
387 387 write(37 from 37) -> (99) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
388 388 write(41 from 41) -> (58) Content-Type: application/mercurial-0.1\r\n
389 389 write(20 from 20) -> (38) Content-Length: 42\r\n
390 390 write(2 from 2) -> (36) \r\n
391 391 write(36 from 42) -> (0) 96ee1d7354c4ad7372047672c36a1f561e3a
392 392 write limit reached; closing socket
393 393
394 394 $ rm -f error.log
395 395
396 396 Server sends incomplete headers for getbundle response
397 397
398 398 $ hg --config badserver.closeaftersendbytes=895 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
399 399 $ cat hg.pid > $DAEMON_PIDS
400 400
401 401 TODO this output is terrible
402 402
403 403 $ hg clone http://localhost:$HGPORT/ clone
404 404 requesting all changes
405 405 abort: 'http://localhost:$HGPORT/' does not appear to be an hg repository:
406 406 ---%<--- (application/mercuri)
407 407
408 408 ---%<---
409 409 !
410 410 [255]
411 411
412 412 $ killdaemons.py $DAEMON_PIDS
413 413
414 414 $ cat error.log
415 415 readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
416 416 readline(-1) -> (27) Accept-Encoding: identity\r\n
417 417 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
418 418 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
419 419 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
420 420 readline(-1) -> (2) \r\n
421 421 write(36 from 36) -> (859) HTTP/1.1 200 Script output follows\r\n
422 422 write(23 from 23) -> (836) Server: badhttpserver\r\n
423 423 write(37 from 37) -> (799) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
424 424 write(41 from 41) -> (758) Content-Type: application/mercurial-0.1\r\n
425 425 write(21 from 21) -> (737) Content-Length: 405\r\n
426 426 write(2 from 2) -> (735) \r\n
427 427 write(405 from 405) -> (330) lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
428 428 readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
429 429 readline(-1) -> (27) Accept-Encoding: identity\r\n
430 430 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
431 431 readline(-1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
432 432 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
433 433 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
434 434 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
435 435 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
436 436 readline(-1) -> (2) \r\n
437 437 write(36 from 36) -> (294) HTTP/1.1 200 Script output follows\r\n
438 438 write(23 from 23) -> (271) Server: badhttpserver\r\n
439 439 write(37 from 37) -> (234) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
440 440 write(41 from 41) -> (193) Content-Type: application/mercurial-0.1\r\n
441 441 write(20 from 20) -> (173) Content-Length: 42\r\n
442 442 write(2 from 2) -> (171) \r\n
443 443 write(42 from 42) -> (129) 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
444 444 readline(65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
445 445 readline(-1) -> (27) Accept-Encoding: identity\r\n
446 446 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
447 447 readline(-1) -> (396) x-hgarg-1: bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n
448 448 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
449 449 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
450 450 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
451 451 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
452 452 readline(-1) -> (2) \r\n
453 453 write(36 from 36) -> (93) HTTP/1.1 200 Script output follows\r\n
454 454 write(23 from 23) -> (70) Server: badhttpserver\r\n
455 455 write(37 from 37) -> (33) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
456 456 write(33 from 41) -> (0) Content-Type: application/mercuri
457 457 write limit reached; closing socket
458 458 write(36) -> HTTP/1.1 500 Internal Server Error\r\n
459 459
460 460 $ rm -f error.log
461 461
462 462 Server sends empty HTTP body for getbundle
463 463
464 464 $ hg --config badserver.closeaftersendbytes=933 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
465 465 $ cat hg.pid > $DAEMON_PIDS
466 466
467 467 $ hg clone http://localhost:$HGPORT/ clone
468 468 requesting all changes
469 469 abort: HTTP request error (incomplete response)
470 470 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
471 471 [255]
472 472
473 473 $ killdaemons.py $DAEMON_PIDS
474 474
475 475 $ cat error.log
476 476 readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
477 477 readline(-1) -> (27) Accept-Encoding: identity\r\n
478 478 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
479 479 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
480 480 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
481 481 readline(-1) -> (2) \r\n
482 482 write(36 from 36) -> (897) HTTP/1.1 200 Script output follows\r\n
483 483 write(23 from 23) -> (874) Server: badhttpserver\r\n
484 484 write(37 from 37) -> (837) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
485 485 write(41 from 41) -> (796) Content-Type: application/mercurial-0.1\r\n
486 486 write(21 from 21) -> (775) Content-Length: 405\r\n
487 487 write(2 from 2) -> (773) \r\n
488 488 write(405 from 405) -> (368) lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
489 489 readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
490 490 readline(-1) -> (27) Accept-Encoding: identity\r\n
491 491 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
492 492 readline(-1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
493 493 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
494 494 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
495 495 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
496 496 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
497 497 readline(-1) -> (2) \r\n
498 498 write(36 from 36) -> (332) HTTP/1.1 200 Script output follows\r\n
499 499 write(23 from 23) -> (309) Server: badhttpserver\r\n
500 500 write(37 from 37) -> (272) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
501 501 write(41 from 41) -> (231) Content-Type: application/mercurial-0.1\r\n
502 502 write(20 from 20) -> (211) Content-Length: 42\r\n
503 503 write(2 from 2) -> (209) \r\n
504 504 write(42 from 42) -> (167) 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
505 505 readline(65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
506 506 readline(-1) -> (27) Accept-Encoding: identity\r\n
507 507 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
508 508 readline(-1) -> (396) x-hgarg-1: bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n
509 509 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
510 510 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
511 511 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
512 512 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
513 513 readline(-1) -> (2) \r\n
514 514 write(36 from 36) -> (131) HTTP/1.1 200 Script output follows\r\n
515 515 write(23 from 23) -> (108) Server: badhttpserver\r\n
516 516 write(37 from 37) -> (71) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
517 517 write(41 from 41) -> (30) Content-Type: application/mercurial-0.2\r\n
518 518 write(28 from 28) -> (2) Transfer-Encoding: chunked\r\n
519 519 write(2 from 2) -> (0) \r\n
520 520 write limit reached; closing socket
521 521 write(36) -> HTTP/1.1 500 Internal Server Error\r\n
522 522
523 523 $ rm -f error.log
524 524
525 525 Server sends partial compression string
526 526
527 527 $ hg --config badserver.closeaftersendbytes=945 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
528 528 $ cat hg.pid > $DAEMON_PIDS
529 529
530 530 $ hg clone http://localhost:$HGPORT/ clone
531 531 requesting all changes
532 532 abort: HTTP request error (incomplete response; expected 1 bytes got 3)
533 533 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
534 534 [255]
535 535
536 536 $ killdaemons.py $DAEMON_PIDS
537 537
538 538 $ cat error.log
539 539 readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
540 540 readline(-1) -> (27) Accept-Encoding: identity\r\n
541 541 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
542 542 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
543 543 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
544 544 readline(-1) -> (2) \r\n
545 545 write(36 from 36) -> (909) HTTP/1.1 200 Script output follows\r\n
546 546 write(23 from 23) -> (886) Server: badhttpserver\r\n
547 547 write(37 from 37) -> (849) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
548 548 write(41 from 41) -> (808) Content-Type: application/mercurial-0.1\r\n
549 549 write(21 from 21) -> (787) Content-Length: 405\r\n
550 550 write(2 from 2) -> (785) \r\n
551 551 write(405 from 405) -> (380) lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
552 552 readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
553 553 readline(-1) -> (27) Accept-Encoding: identity\r\n
554 554 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
555 555 readline(-1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
556 556 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
557 557 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
558 558 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
559 559 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
560 560 readline(-1) -> (2) \r\n
561 561 write(36 from 36) -> (344) HTTP/1.1 200 Script output follows\r\n
562 562 write(23 from 23) -> (321) Server: badhttpserver\r\n
563 563 write(37 from 37) -> (284) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
564 564 write(41 from 41) -> (243) Content-Type: application/mercurial-0.1\r\n
565 565 write(20 from 20) -> (223) Content-Length: 42\r\n
566 566 write(2 from 2) -> (221) \r\n
567 567 write(42 from 42) -> (179) 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
568 568 readline(65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
569 569 readline(-1) -> (27) Accept-Encoding: identity\r\n
570 570 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
571 571 readline(-1) -> (396) x-hgarg-1: bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n
572 572 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
573 573 readline(-1) -> (35) accept: application/mercurial-0.1\r\n
574 574 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
575 575 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
576 576 readline(-1) -> (2) \r\n
577 577 write(36 from 36) -> (143) HTTP/1.1 200 Script output follows\r\n
578 578 write(23 from 23) -> (120) Server: badhttpserver\r\n
579 579 write(37 from 37) -> (83) Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
580 580 write(41 from 41) -> (42) Content-Type: application/mercurial-0.2\r\n
581 581 write(28 from 28) -> (14) Transfer-Encoding: chunked\r\n
582 582 write(2 from 2) -> (12) \r\n
583 583 write(6 from 6) -> (6) 1\\r\\n\x04\\r\\n (esc)
584 584 write(6 from 9) -> (0) 4\r\nnon
585 585 write limit reached; closing socket
586 586 write(27) -> 15\r\nInternal Server Error\r\n
587 587
588 588 $ rm -f error.log
589 589
590 590 Server sends partial bundle2 header magic
591 591
592 592 $ hg --config badserver.closeaftersendbytes=954 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
593 593 $ cat hg.pid > $DAEMON_PIDS
594 594
595 595 $ hg clone http://localhost:$HGPORT/ clone
596 596 requesting all changes
597 597 abort: HTTP request error (incomplete response; expected 1 bytes got 3)
598 598 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
599 599 [255]
600 600
601 601 $ killdaemons.py $DAEMON_PIDS
602 602
603 603 $ tail -7 error.log
604 604 write(28 from 28) -> (23) Transfer-Encoding: chunked\r\n
605 605 write(2 from 2) -> (21) \r\n
606 606 write(6 from 6) -> (15) 1\\r\\n\x04\\r\\n (esc)
607 607 write(9 from 9) -> (6) 4\r\nnone\r\n
608 608 write(6 from 9) -> (0) 4\r\nHG2
609 609 write limit reached; closing socket
610 610 write(27) -> 15\r\nInternal Server Error\r\n
611 611
612 612 $ rm -f error.log
613 613
614 614 Server sends incomplete bundle2 stream params length
615 615
616 616 $ hg --config badserver.closeaftersendbytes=963 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
617 617 $ cat hg.pid > $DAEMON_PIDS
618 618
619 619 $ hg clone http://localhost:$HGPORT/ clone
620 620 requesting all changes
621 621 abort: HTTP request error (incomplete response; expected 1 bytes got 3)
622 622 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
623 623 [255]
624 624
625 625 $ killdaemons.py $DAEMON_PIDS
626 626
627 627 $ tail -8 error.log
628 628 write(28 from 28) -> (32) Transfer-Encoding: chunked\r\n
629 629 write(2 from 2) -> (30) \r\n
630 630 write(6 from 6) -> (24) 1\\r\\n\x04\\r\\n (esc)
631 631 write(9 from 9) -> (15) 4\r\nnone\r\n
632 632 write(9 from 9) -> (6) 4\r\nHG20\r\n
633 633 write(6 from 9) -> (0) 4\\r\\n\x00\x00\x00 (esc)
634 634 write limit reached; closing socket
635 635 write(27) -> 15\r\nInternal Server Error\r\n
636 636
637 637 $ rm -f error.log
638 638
639 639 Servers stops after bundle2 stream params header
640 640
641 641 $ hg --config badserver.closeaftersendbytes=966 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
642 642 $ cat hg.pid > $DAEMON_PIDS
643 643
644 644 $ hg clone http://localhost:$HGPORT/ clone
645 645 requesting all changes
646 646 abort: HTTP request error (incomplete response)
647 647 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
648 648 [255]
649 649
650 650 $ killdaemons.py $DAEMON_PIDS
651 651
652 652 $ tail -8 error.log
653 653 write(28 from 28) -> (35) Transfer-Encoding: chunked\r\n
654 654 write(2 from 2) -> (33) \r\n
655 655 write(6 from 6) -> (27) 1\\r\\n\x04\\r\\n (esc)
656 656 write(9 from 9) -> (18) 4\r\nnone\r\n
657 657 write(9 from 9) -> (9) 4\r\nHG20\r\n
658 658 write(9 from 9) -> (0) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
659 659 write limit reached; closing socket
660 660 write(27) -> 15\r\nInternal Server Error\r\n
661 661
662 662 $ rm -f error.log
663 663
664 664 Server stops sending after bundle2 part header length
665 665
666 666 $ hg --config badserver.closeaftersendbytes=975 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
667 667 $ cat hg.pid > $DAEMON_PIDS
668 668
669 669 $ hg clone http://localhost:$HGPORT/ clone
670 670 requesting all changes
671 671 abort: HTTP request error (incomplete response)
672 672 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
673 673 [255]
674 674
675 675 $ killdaemons.py $DAEMON_PIDS
676 676
677 677 $ tail -9 error.log
678 678 write(28 from 28) -> (44) Transfer-Encoding: chunked\r\n
679 679 write(2 from 2) -> (42) \r\n
680 680 write(6 from 6) -> (36) 1\\r\\n\x04\\r\\n (esc)
681 681 write(9 from 9) -> (27) 4\r\nnone\r\n
682 682 write(9 from 9) -> (18) 4\r\nHG20\r\n
683 683 write(9 from 9) -> (9) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
684 684 write(9 from 9) -> (0) 4\\r\\n\x00\x00\x00)\\r\\n (esc)
685 685 write limit reached; closing socket
686 686 write(27) -> 15\r\nInternal Server Error\r\n
687 687
688 688 $ rm -f error.log
689 689
690 690 Server stops sending after bundle2 part header
691 691
692 692 $ hg --config badserver.closeaftersendbytes=1022 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
693 693 $ cat hg.pid > $DAEMON_PIDS
694 694
695 695 $ hg clone http://localhost:$HGPORT/ clone
696 696 requesting all changes
697 697 adding changesets
698 698 transaction abort!
699 699 rollback completed
700 700 abort: HTTP request error (incomplete response)
701 701 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
702 702 [255]
703 703
704 704 $ killdaemons.py $DAEMON_PIDS
705 705
706 706 $ tail -10 error.log
707 707 write(28 from 28) -> (91) Transfer-Encoding: chunked\r\n
708 708 write(2 from 2) -> (89) \r\n
709 709 write(6 from 6) -> (83) 1\\r\\n\x04\\r\\n (esc)
710 710 write(9 from 9) -> (74) 4\r\nnone\r\n
711 711 write(9 from 9) -> (65) 4\r\nHG20\r\n
712 712 write(9 from 9) -> (56) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
713 713 write(9 from 9) -> (47) 4\\r\\n\x00\x00\x00)\\r\\n (esc)
714 714 write(47 from 47) -> (0) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc)
715 715 write limit reached; closing socket
716 716 write(27) -> 15\r\nInternal Server Error\r\n
717 717
718 718 $ rm -f error.log
719 719
720 720 Server stops after bundle2 part payload chunk size
721 721
722 722 $ hg --config badserver.closeaftersendbytes=1031 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
723 723 $ cat hg.pid > $DAEMON_PIDS
724 724
725 725 $ hg clone http://localhost:$HGPORT/ clone
726 726 requesting all changes
727 727 adding changesets
728 728 transaction abort!
729 729 rollback completed
730 730 abort: HTTP request error (incomplete response)
731 731 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
732 732 [255]
733 733
734 734 $ killdaemons.py $DAEMON_PIDS
735 735
736 736 $ tail -11 error.log
737 737 write(28 from 28) -> (100) Transfer-Encoding: chunked\r\n
738 738 write(2 from 2) -> (98) \r\n
739 739 write(6 from 6) -> (92) 1\\r\\n\x04\\r\\n (esc)
740 740 write(9 from 9) -> (83) 4\r\nnone\r\n
741 741 write(9 from 9) -> (74) 4\r\nHG20\r\n
742 742 write(9 from 9) -> (65) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
743 743 write(9 from 9) -> (56) 4\\r\\n\x00\x00\x00)\\r\\n (esc)
744 744 write(47 from 47) -> (9) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc)
745 745 write(9 from 9) -> (0) 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
746 746 write limit reached; closing socket
747 747 write(27) -> 15\r\nInternal Server Error\r\n
748 748
749 749 $ rm -f error.log
750 750
751 751 Server stops sending in middle of bundle2 payload chunk
752 752
753 753 $ hg --config badserver.closeaftersendbytes=1504 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
754 754 $ cat hg.pid > $DAEMON_PIDS
755 755
756 756 $ hg clone http://localhost:$HGPORT/ clone
757 757 requesting all changes
758 758 adding changesets
759 759 transaction abort!
760 760 rollback completed
761 761 abort: HTTP request error (incomplete response)
762 762 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
763 763 [255]
764 764
765 765 $ killdaemons.py $DAEMON_PIDS
766 766
767 767 $ tail -12 error.log
768 768 write(28 from 28) -> (573) Transfer-Encoding: chunked\r\n
769 769 write(2 from 2) -> (571) \r\n
770 770 write(6 from 6) -> (565) 1\\r\\n\x04\\r\\n (esc)
771 771 write(9 from 9) -> (556) 4\r\nnone\r\n
772 772 write(9 from 9) -> (547) 4\r\nHG20\r\n
773 773 write(9 from 9) -> (538) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
774 774 write(9 from 9) -> (529) 4\\r\\n\x00\x00\x00)\\r\\n (esc)
775 775 write(47 from 47) -> (482) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc)
776 776 write(9 from 9) -> (473) 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
777 777 write(473 from 473) -> (0) 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
778 778 write limit reached; closing socket
779 779 write(27) -> 15\r\nInternal Server Error\r\n
780 780
781 781 $ rm -f error.log
782 782
783 783 Server stops sending after 0 length payload chunk size
784 784
785 785 $ hg --config badserver.closeaftersendbytes=1513 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
786 786 $ cat hg.pid > $DAEMON_PIDS
787 787
788 788 $ hg clone http://localhost:$HGPORT/ clone
789 789 requesting all changes
790 790 adding changesets
791 791 adding manifests
792 792 adding file changes
793 793 added 1 changesets with 1 changes to 1 files
794 794 transaction abort!
795 795 rollback completed
796 796 abort: HTTP request error (incomplete response)
797 797 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
798 798 [255]
799 799
800 800 $ killdaemons.py $DAEMON_PIDS
801 801
802 802 $ tail -13 error.log
803 803 write(28 from 28) -> (582) Transfer-Encoding: chunked\r\n
804 804 write(2 from 2) -> (580) \r\n
805 805 write(6 from 6) -> (574) 1\\r\\n\x04\\r\\n (esc)
806 806 write(9 from 9) -> (565) 4\r\nnone\r\n
807 807 write(9 from 9) -> (556) 4\r\nHG20\r\n
808 808 write(9 from 9) -> (547) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
809 809 write(9 from 9) -> (538) 4\\r\\n\x00\x00\x00)\\r\\n (esc)
810 810 write(47 from 47) -> (491) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc)
811 811 write(9 from 9) -> (482) 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
812 812 write(473 from 473) -> (9) 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
813 813 write(9 from 9) -> (0) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
814 814 write limit reached; closing socket
815 815 write(27) -> 15\r\nInternal Server Error\r\n
816 816
817 817 $ rm -f error.log
818 818
819 819 Server stops sending after 0 part bundle part header (indicating end of bundle2 payload)
820 820 This is before the 0 size chunked transfer part that signals end of HTTP response.
821 821
822 822 $ hg --config badserver.closeaftersendbytes=1710 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
823 823 $ cat hg.pid > $DAEMON_PIDS
824 824
825 825 $ hg clone http://localhost:$HGPORT/ clone
826 826 requesting all changes
827 827 adding changesets
828 828 adding manifests
829 829 adding file changes
830 830 added 1 changesets with 1 changes to 1 files
831 831 updating to branch default
832 832 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
833 833
834 834 $ killdaemons.py $DAEMON_PIDS
835 835
836 836 $ tail -22 error.log
837 837 write(28 from 28) -> (779) Transfer-Encoding: chunked\r\n
838 838 write(2 from 2) -> (777) \r\n
839 839 write(6 from 6) -> (771) 1\\r\\n\x04\\r\\n (esc)
840 840 write(9 from 9) -> (762) 4\r\nnone\r\n
841 841 write(9 from 9) -> (753) 4\r\nHG20\r\n
842 842 write(9 from 9) -> (744) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
843 843 write(9 from 9) -> (735) 4\\r\\n\x00\x00\x00)\\r\\n (esc)
844 844 write(47 from 47) -> (688) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc)
845 845 write(9 from 9) -> (679) 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
846 846 write(473 from 473) -> (206) 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
847 847 write(9 from 9) -> (197) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
848 848 write(9 from 9) -> (188) 4\\r\\n\x00\x00\x00 \\r\\n (esc)
849 849 write(38 from 38) -> (150) 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00 \x06namespacephases\\r\\n (esc)
850 850 write(9 from 9) -> (141) 4\\r\\n\x00\x00\x00:\\r\\n (esc)
851 851 write(64 from 64) -> (77) 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c 1\npublishing True\r\n
852 852 write(9 from 9) -> (68) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
853 853 write(9 from 9) -> (59) 4\\r\\n\x00\x00\x00#\\r\\n (esc)
854 854 write(41 from 41) -> (18) 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00 namespacebookmarks\\r\\n (esc)
855 855 write(9 from 9) -> (9) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
856 856 write(9 from 9) -> (0) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
857 857 write limit reached; closing socket
858 858 write(27) -> 15\r\nInternal Server Error\r\n
859 859
860 860 $ rm -f error.log
861 861 $ rm -rf clone
862 862
863 863 Server sends a size 0 chunked-transfer size without terminating \r\n
864 864
865 865 $ hg --config badserver.closeaftersendbytes=1713 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
866 866 $ cat hg.pid > $DAEMON_PIDS
867 867
868 868 $ hg clone http://localhost:$HGPORT/ clone
869 869 requesting all changes
870 870 adding changesets
871 871 adding manifests
872 872 adding file changes
873 873 added 1 changesets with 1 changes to 1 files
874 874 updating to branch default
875 875 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
876 876
877 877 $ killdaemons.py $DAEMON_PIDS
878 878
879 879 $ tail -23 error.log
880 880 write(28 from 28) -> (782) Transfer-Encoding: chunked\r\n
881 881 write(2 from 2) -> (780) \r\n
882 882 write(6 from 6) -> (774) 1\\r\\n\x04\\r\\n (esc)
883 883 write(9 from 9) -> (765) 4\r\nnone\r\n
884 884 write(9 from 9) -> (756) 4\r\nHG20\r\n
885 885 write(9 from 9) -> (747) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
886 886 write(9 from 9) -> (738) 4\\r\\n\x00\x00\x00)\\r\\n (esc)
887 887 write(47 from 47) -> (691) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version02nbchanges1\\r\\n (esc)
888 888 write(9 from 9) -> (682) 4\\r\\n\x00\x00\x01\xd2\\r\\n (esc)
889 889 write(473 from 473) -> (209) 1d2\\r\\n\x00\x00\x00\xb2\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa1j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00h\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
890 890 write(9 from 9) -> (200) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
891 891 write(9 from 9) -> (191) 4\\r\\n\x00\x00\x00 \\r\\n (esc)
892 892 write(38 from 38) -> (153) 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00 \x06namespacephases\\r\\n (esc)
893 893 write(9 from 9) -> (144) 4\\r\\n\x00\x00\x00:\\r\\n (esc)
894 894 write(64 from 64) -> (80) 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c 1\npublishing True\r\n
895 895 write(9 from 9) -> (71) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
896 896 write(9 from 9) -> (62) 4\\r\\n\x00\x00\x00#\\r\\n (esc)
897 897 write(41 from 41) -> (21) 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00 namespacebookmarks\\r\\n (esc)
898 898 write(9 from 9) -> (12) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
899 899 write(9 from 9) -> (3) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
900 900 write(3 from 5) -> (0) 0\r\n
901 901 write limit reached; closing socket
902 902 write(27) -> 15\r\nInternal Server Error\r\n
903 903
904 904 $ rm -f error.log
905 905 $ rm -rf clone
General Comments 0
You need to be logged in to leave comments. Login now