Mercurial > hg > mercurial-source
comparison mercurial/url.py @ 29977:dffe78d80a6c
sslutil: convert socket validation from a class to a function (API)
Now that the socket validator doesn't have any instance state,
we can make it a generic function.
The "validator" class has been converted into the "validatesocket"
function and all consumers have been updated.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 15 May 2016 11:38:38 -0700 |
parents | 032c4c2f802a |
children | e6de6ef3e426 |
comparison
equal
deleted
inserted
replaced
29976:33006bd6a1d7 | 29977:dffe78d80a6c |
---|---|
354 _generic_proxytunnel(self) | 354 _generic_proxytunnel(self) |
355 host = self.realhostport.rsplit(':', 1)[0] | 355 host = self.realhostport.rsplit(':', 1)[0] |
356 self.sock = sslutil.wrapsocket( | 356 self.sock = sslutil.wrapsocket( |
357 self.sock, self.key_file, self.cert_file, serverhostname=host, | 357 self.sock, self.key_file, self.cert_file, serverhostname=host, |
358 **sslutil.sslkwargs(self.ui, host)) | 358 **sslutil.sslkwargs(self.ui, host)) |
359 sslutil.validator(self.ui, host)(self.sock) | 359 sslutil.validatesocket(self.sock) |
360 | 360 |
361 class httpshandler(keepalive.KeepAliveHandler, urlreq.httpshandler): | 361 class httpshandler(keepalive.KeepAliveHandler, urlreq.httpshandler): |
362 def __init__(self, ui): | 362 def __init__(self, ui): |
363 keepalive.KeepAliveHandler.__init__(self) | 363 keepalive.KeepAliveHandler.__init__(self) |
364 urlreq.httpshandler.__init__(self) | 364 urlreq.httpshandler.__init__(self) |