Mercurial > hg
comparison hgext/zeroconf/Zeroconf.py @ 35931:b202d360d2a4
sshpeer: move URL validation out of sshpeer.__init__
We will soon have another SSH peer class to support the new version
of the SSH protocol. However, we won't know which peer class to
instantiate until we perform a handshake on an active connection.
This means that we need to move connection establishment and handshake
code out of sshpeer.__init__.
This commit starts the process of migrating peer creation code
out of sshpeer.__init__ into instance(), which is the API for
creating peers.
The moved code no longer calls _abort(). _abort() runs _cleanup() and
raises. _cleanup() only performs actions on self._pipe*. These objects
aren't instantiated until we actually connect to the peer. So _abort()
was not necessary in the old code.
To keep the API the same, __init__() now makes a redundant call to
util.url(). This will be fixed in subsequent commits.
Differential Revision: https://phab.mercurial-scm.org/D2027
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 04 Feb 2018 12:55:18 -0800 |
parents | 31451f3f4b56 |
children | 876494fd967d |
comparison
equal
deleted
inserted
replaced
35930:83d67257ba90 | 35931:b202d360d2a4 |
---|