Mercurial > hg
changeset 29225:b115eed11780
sslutil: use a dict for hanging hg state off the wrapped socket
I plan on introducing more state on the socket instance. Instead
of using multiple variables, let's just use one to minimize risk
of name collision.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 15 May 2016 11:25:07 -0700 |
parents | 7424f4294199 |
children | 33006bd6a1d7 |
files | mercurial/sslutil.py |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/sslutil.py Thu May 05 19:10:18 2016 -0700 +++ b/mercurial/sslutil.py Sun May 15 11:25:07 2016 -0700 @@ -171,7 +171,9 @@ if not sslsocket.cipher(): raise error.Abort(_('ssl connection failed')) - sslsocket._hgcaloaded = caloaded + sslsocket._hgstate = { + 'caloaded': caloaded, + } return sslsocket @@ -341,7 +343,7 @@ (host, nicefingerprint)) return - if not sock._hgcaloaded: + if not sock._hgstate['caloaded']: if strict: raise error.Abort(_('%s certificate with fingerprint %s not ' 'verified') % (host, nicefingerprint),