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