Show More
@@ -90,6 +90,7 b' import socket' | |||||
90 | import sys |
|
90 | import sys | |
91 | import threading |
|
91 | import threading | |
92 |
|
92 | |||
|
93 | from .i18n import _ | |||
93 | from . import ( |
|
94 | from . import ( | |
94 | util, |
|
95 | util, | |
95 | ) |
|
96 | ) | |
@@ -231,6 +232,10 b' class KeepAliveHandler(object):' | |||||
231 | self._cm.add(host, h, 0) |
|
232 | self._cm.add(host, h, 0) | |
232 | self._start_transaction(h, req) |
|
233 | self._start_transaction(h, req) | |
233 | r = h.getresponse() |
|
234 | r = h.getresponse() | |
|
235 | # The string form of BadStatusLine is the status line. Add some context | |||
|
236 | # to make the error message slightly more useful. | |||
|
237 | except httplib.BadStatusLine as err: | |||
|
238 | raise urlerr.urlerror(_('bad HTTP status line: %s') % err.line) | |||
234 | except (socket.error, httplib.HTTPException) as err: |
|
239 | except (socket.error, httplib.HTTPException) as err: | |
235 | raise urlerr.urlerror(err) |
|
240 | raise urlerr.urlerror(err) | |
236 |
|
241 |
@@ -68,10 +68,8 b' Failure to read all bytes in initial HTT' | |||||
68 | $ hg --config badserver.closeafterrecvbytes=1 serve -p $HGPORT -d --pid-file=hg.pid -E error.log |
|
68 | $ hg --config badserver.closeafterrecvbytes=1 serve -p $HGPORT -d --pid-file=hg.pid -E error.log | |
69 | $ cat hg.pid > $DAEMON_PIDS |
|
69 | $ cat hg.pid > $DAEMON_PIDS | |
70 |
|
70 | |||
71 | TODO this error message is not very good |
|
|||
72 |
|
||||
73 | $ hg clone http://localhost:$HGPORT/ clone |
|
71 | $ hg clone http://localhost:$HGPORT/ clone | |
74 | abort: error: '' |
|
72 | abort: error: bad HTTP status line: '' | |
75 | [255] |
|
73 | [255] | |
76 |
|
74 | |||
77 | $ killdaemons.py $DAEMON_PIDS |
|
75 | $ killdaemons.py $DAEMON_PIDS | |
@@ -87,7 +85,7 b' Same failure, but server reads full HTTP' | |||||
87 | $ hg --config badserver.closeafterrecvbytes=40 serve -p $HGPORT -d --pid-file=hg.pid -E error.log |
|
85 | $ hg --config badserver.closeafterrecvbytes=40 serve -p $HGPORT -d --pid-file=hg.pid -E error.log | |
88 | $ cat hg.pid > $DAEMON_PIDS |
|
86 | $ cat hg.pid > $DAEMON_PIDS | |
89 | $ hg clone http://localhost:$HGPORT/ clone |
|
87 | $ hg clone http://localhost:$HGPORT/ clone | |
90 | abort: error: '' |
|
88 | abort: error: bad HTTP status line: '' | |
91 | [255] |
|
89 | [255] | |
92 |
|
90 | |||
93 | $ killdaemons.py $DAEMON_PIDS |
|
91 | $ killdaemons.py $DAEMON_PIDS | |
@@ -104,7 +102,7 b' Failure on subsequent HTTP request on th' | |||||
104 | $ hg --config badserver.closeafterrecvbytes=210 serve -p $HGPORT -d --pid-file=hg.pid -E error.log |
|
102 | $ hg --config badserver.closeafterrecvbytes=210 serve -p $HGPORT -d --pid-file=hg.pid -E error.log | |
105 | $ cat hg.pid > $DAEMON_PIDS |
|
103 | $ cat hg.pid > $DAEMON_PIDS | |
106 | $ hg clone http://localhost:$HGPORT/ clone |
|
104 | $ hg clone http://localhost:$HGPORT/ clone | |
107 | abort: error: '' |
|
105 | abort: error: bad HTTP status line: '' | |
108 | [255] |
|
106 | [255] | |
109 |
|
107 | |||
110 | $ killdaemons.py $DAEMON_PIDS |
|
108 | $ killdaemons.py $DAEMON_PIDS | |
@@ -143,7 +141,7 b' Failure to read getbundle HTTP request' | |||||
143 | $ cat hg.pid > $DAEMON_PIDS |
|
141 | $ cat hg.pid > $DAEMON_PIDS | |
144 | $ hg clone http://localhost:$HGPORT/ clone |
|
142 | $ hg clone http://localhost:$HGPORT/ clone | |
145 | requesting all changes |
|
143 | requesting all changes | |
146 | abort: error: '' |
|
144 | abort: error: bad HTTP status line: '' | |
147 | [255] |
|
145 | [255] | |
148 |
|
146 | |||
149 | $ killdaemons.py $DAEMON_PIDS |
|
147 | $ killdaemons.py $DAEMON_PIDS | |
@@ -200,7 +198,7 b' Now do a variation using POST to send ar' | |||||
200 | $ cat hg.pid > $DAEMON_PIDS |
|
198 | $ cat hg.pid > $DAEMON_PIDS | |
201 |
|
199 | |||
202 | $ hg clone http://localhost:$HGPORT/ clone |
|
200 | $ hg clone http://localhost:$HGPORT/ clone | |
203 | abort: error: '' |
|
201 | abort: error: bad HTTP status line: '' | |
204 | [255] |
|
202 | [255] | |
205 |
|
203 | |||
206 | $ killdaemons.py $DAEMON_PIDS |
|
204 | $ killdaemons.py $DAEMON_PIDS | |
@@ -251,7 +249,7 b' Server sends a single character from the' | |||||
251 | $ cat hg.pid > $DAEMON_PIDS |
|
249 | $ cat hg.pid > $DAEMON_PIDS | |
252 |
|
250 | |||
253 | $ hg clone http://localhost:$HGPORT/ clone |
|
251 | $ hg clone http://localhost:$HGPORT/ clone | |
254 | abort: error: H |
|
252 | abort: error: bad HTTP status line: H | |
255 | [255] |
|
253 | [255] | |
256 |
|
254 | |||
257 | $ killdaemons.py $DAEMON_PIDS |
|
255 | $ killdaemons.py $DAEMON_PIDS |
General Comments 0
You need to be logged in to leave comments.
Login now