Show More
@@ -87,11 +87,14 b' class httpconnection(keepalive.HTTPConne' | |||||
87 | for chunk in util.filechunkiter(data): |
|
87 | for chunk in util.filechunkiter(data): | |
88 | keepalive.HTTPConnection.send(self, chunk) |
|
88 | keepalive.HTTPConnection.send(self, chunk) | |
89 |
|
89 | |||
90 | class httphandler(keepalive.HTTPHandler): |
|
90 | class basehttphandler(keepalive.HTTPHandler): | |
91 | def http_open(self, req): |
|
91 | def http_open(self, req): | |
92 | return self.do_open(httpconnection, req) |
|
92 | return self.do_open(httpconnection, req) | |
93 |
|
93 | |||
|
94 | has_https = hasattr(urllib2, 'HTTPSHandler') | |||
|
95 | if has_https: | |||
94 | class httpsconnection(httplib.HTTPSConnection): |
|
96 | class httpsconnection(httplib.HTTPSConnection): | |
|
97 | response_class = keepalive.HTTPResponse | |||
95 | # must be able to send big bundle as stream. |
|
98 | # must be able to send big bundle as stream. | |
96 |
|
99 | |||
97 | def send(self, data): |
|
100 | def send(self, data): | |
@@ -103,9 +106,12 b' class httpsconnection(httplib.HTTPSConne' | |||||
103 | for chunk in util.filechunkiter(data): |
|
106 | for chunk in util.filechunkiter(data): | |
104 | httplib.HTTPSConnection.send(self, chunk) |
|
107 | httplib.HTTPSConnection.send(self, chunk) | |
105 |
|
108 | |||
106 |
class http |
|
109 | class httphandler(basehttphandler, urllib2.HTTPSHandler): | |
107 | def https_open(self, req): |
|
110 | def https_open(self, req): | |
108 | return self.do_open(httpsconnection, req) |
|
111 | return self.do_open(httpsconnection, req) | |
|
112 | else: | |||
|
113 | class httphandler(basehttphandler): | |||
|
114 | pass | |||
109 |
|
115 | |||
110 | class httprepository(remoterepository): |
|
116 | class httprepository(remoterepository): | |
111 | def __init__(self, ui, path): |
|
117 | def __init__(self, ui, path): | |
@@ -176,7 +182,6 b' class httprepository(remoterepository):' | |||||
176 |
|
182 | |||
177 | opener = urllib2.build_opener( |
|
183 | opener = urllib2.build_opener( | |
178 | handler, |
|
184 | handler, | |
179 | httpshandler(), |
|
|||
180 | urllib2.HTTPBasicAuthHandler(passmgr), |
|
185 | urllib2.HTTPBasicAuthHandler(passmgr), | |
181 | urllib2.HTTPDigestAuthHandler(passmgr)) |
|
186 | urllib2.HTTPDigestAuthHandler(passmgr)) | |
182 |
|
187 | |||
@@ -322,4 +327,8 b' class httprepository(remoterepository):' | |||||
322 | os.unlink(tempname) |
|
327 | os.unlink(tempname) | |
323 |
|
328 | |||
324 | class httpsrepository(httprepository): |
|
329 | class httpsrepository(httprepository): | |
325 | pass |
|
330 | def __init__(self, ui, path): | |
|
331 | if not has_https: | |||
|
332 | raise util.Abort(_('Python support for SSL and HTTPS ' | |||
|
333 | 'is not installed')) | |||
|
334 | httprepository.__init__(self, ui, path) |
General Comments 0
You need to be logged in to leave comments.
Login now