[Pkg-privacy-commits] [pyptlib] 95/136: - have client.reportMethodSuccess take an entire protocol string rather than assuming socks
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:25:14 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository pyptlib.
commit 4bfa3edd3b741a7abd44eca72b75234def420054
Author: Ximin Luo <infinity0 at gmx.com>
Date: Mon Sep 2 15:13:16 2013 +0100
- have client.reportMethodSuccess take an entire protocol string rather than assuming socks
---
pyptlib/client.py | 8 ++++----
sphinx/API.rst | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/pyptlib/client.py b/pyptlib/client.py
index 7f7b2b8..03554ab 100644
--- a/pyptlib/client.py
+++ b/pyptlib/client.py
@@ -16,19 +16,19 @@ class ClientTransportPlugin(TransportPlugin):
configType = ClientConfig
methodName = 'CMETHOD'
- def reportMethodSuccess(self, name, socksVersion, addrport, args=None, optArgs=None):
+ def reportMethodSuccess(self, name, protocol, addrport, args=None, optArgs=None):
"""
Write a message to stdout announcing that a transport was
successfully launched.
:param str name: Name of transport.
- :param int socksVersion: The SOCKS protocol version.
+ :param str protocol: Name of protocol to communicate using.
:param tuple addrport: (addr,port) where this transport is listening for connections.
:param str args: ARGS field for this transport.
:param str optArgs: OPT-ARGS field for this transport.
"""
- methodLine = 'CMETHOD %s socks%s %s:%s' % (name, socksVersion,
+ methodLine = 'CMETHOD %s %s %s:%s' % (name, protocol,
addrport[0], addrport[1])
if args and len(args) > 0:
methodLine = methodLine + ' ARGS=' + args.join(',')
@@ -51,7 +51,7 @@ def init(supported_transports):
def reportSuccess(name, socksVersion, addrport, args=None, optArgs=None):
"""DEPRECATED. Use ClientTransportPlugin().reportMethodSuccess() instead."""
config = ClientTransportPlugin()
- config.reportMethodSuccess(name, socksVersion, addrport, args, optArgs)
+ config.reportMethodSuccess(name, "socks%s" % socksVersion, addrport, args, optArgs)
def reportFailure(name, message):
"""DEPRECATED. Use ClientTransportPlugin().reportMethodError() instead."""
diff --git a/sphinx/API.rst b/sphinx/API.rst
index 09ed55c..00de4d6 100644
--- a/sphinx/API.rst
+++ b/sphinx/API.rst
@@ -139,7 +139,7 @@ appropriate call would be:
.. code-block::
python
- client.reportMethodSuccess('rot13', 5, ('127.0.0.1', 42042))
+ client.reportMethodSuccess('rot13', 'socks5', ('127.0.0.1', 42042))
Every time a transport failed to launch, the application calls
:func:`client.reportMethodError
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/pyptlib.git
More information about the Pkg-privacy-commits
mailing list