/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/HTTPTestUtil.py

  • Committer: v.ladeuil+lp at free
  • Date: 2006-10-25 17:47:10 UTC
  • mto: (2145.1.1 keepalive)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: v.ladeuil+lp@free.fr-20061025174710-b8bea783ced1169f
Fix the race condition again and correct some small typos to be in
line with the incremental patches to be proposed.

* bzrlib/transport/http/_pycurl.py:
(PyCurlTransport._curl_perform): Why not inverting them ?

* bzrlib/tests/test_http.py:
(TestWallServer.test_http_has): Whatever we try, httplib still may
raise BadStatusLine, which will be translated to
InvalidHttpResponse, so catch that too.

* bzrlib/tests/HTTPTestUtil.py:
(WallRequestHandler.handle_one_request): Previous fix was not
enough, revert it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    def handle_one_request(self):
37
37
        """Handle a single HTTP request, by abruptly closing the connection"""
38
38
        self.close_connection = 1
39
 
        # But informing higher levels that we *will* close, is
40
 
        # not enough. There is a race condition when the client
41
 
        # is able to try to read before the server can really
42
 
        # close the socket. In that case the client will raise a
43
 
        # InvalidHttpResponse instead of a ConnectionError. And
44
 
        # we want to make it raise ConnectionError, so let's be a
45
 
        # bit more brutal.
46
 
        self.wfile.close()
47
39
 
48
40
 
49
41
class BadStatusRequestHandler(TestingHTTPRequestHandler):