~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/https_server.py

Merge http-leaks into sftp-leaks

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib.tests import (
22
22
    http_server,
23
23
    ssl_certs,
 
24
    test_server,
24
25
    )
25
26
 
26
27
 
44
45
        Return True if we should proceed with this request, False if we should
45
46
        not even touch a single byte in the socket !
46
47
        """
47
 
        serving = self.serving is not None and self.serving.isSet()
 
48
        serving = test_server.TestingTCPServerMixin.verify_request(
 
49
            self, request, client_address)
48
50
        if serving:
49
51
            request.do_handshake()
50
52
        return serving
51
53
 
 
54
 
52
55
class TestingHTTPSServer(TestingHTTPSServerMixin,
53
56
                         http_server.TestingHTTPServer):
54
57
 
58
61
        http_server.TestingHTTPServer.__init__(
59
62
            self, server_address, request_handler_class, test_case_server)
60
63
 
61
 
    def _get_request (self):
62
 
        sock, addr = http_server.TestingHTTPServer._get_request(self)
 
64
    def get_request (self):
 
65
        sock, addr = http_server.TestingHTTPServer.get_request(self)
63
66
        return self._get_ssl_request(sock, addr)
64
67
 
65
68
 
72
75
        http_server.TestingThreadingHTTPServer.__init__(
73
76
            self, server_address, request_handler_class, test_case_server)
74
77
 
75
 
    def _get_request (self):
76
 
        sock, addr = http_server.TestingThreadingHTTPServer._get_request(self)
 
78
    def get_request (self):
 
79
        sock, addr = http_server.TestingThreadingHTTPServer.get_request(self)
77
80
        return self._get_ssl_request(sock, addr)
78
81
 
79
82
 
98
101
        self.cert_file = cert_file
99
102
        self.temp_files = []
100
103
 
101
 
    def create_httpd(self, serv_cls, rhandler_cls):
102
 
        return serv_cls((self.host, self.port), self.request_handler,
103
 
                        self, self.key_file, self.cert_file)
 
104
    def create_server(self):
 
105
        return self.server_class(
 
106
            (self.host, self.port), self.request_handler_class, self,
 
107
            self.key_file, self.cert_file)
104
108
 
105
109
 
106
110
class HTTPSServer_urllib(HTTPSServer):