[Pkg-privacy-commits] [pyptlib] 105/136: Write ARGS portion of SMETHOD line.
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:25:16 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 dc02e34130c437222dd1e6a134aff301900f0384
Author: George Kadianakis <desnacked at riseup.net>
Date: Sat Sep 14 13:50:17 2013 +0300
Write ARGS portion of SMETHOD line.
---
pyptlib/server.py | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/pyptlib/server.py b/pyptlib/server.py
index e529014..9a8845a 100644
--- a/pyptlib/server.py
+++ b/pyptlib/server.py
@@ -23,15 +23,28 @@ class ServerTransportPlugin(TransportPlugin):
:param str name: Name of transport.
:param tuple addrport: (addr,port) where this transport is listening for connections.
- :param str options: Transport options.
+ :param str options: String containting comma-separated
+ transport options in key=value form (as
+ they appear in the ARGS: SMETHOD option)
"""
+ extra = ""
if options:
- self.emit('SMETHOD %s %s:%s %s' % (name, addrport[0],
- addrport[1], options))
- else:
- self.emit('SMETHOD %s %s:%s' % (name, addrport[0],
- addrport[1]))
+ extra = " ARGS:%s" % options
+ elif self.config.serverTransportOptions:
+ optlist = []
+
+ # self.config.serverTransportOptions looks like this:
+ # {'obfs3': {'k':'v'}, 'scramblesuit': {'k2' : 'v2', 'k' : 'v'} }
+ for transport_name, options_dict in self.config.serverTransportOptions.items():
+ if transport_name != name:
+ continue
+
+ for k, v in options_dict.items():
+ optlist.append("%s=%s" % (k,v))
+ extra = " ARGS:%s" % (",".join(optlist))
+
+ self.emit('SMETHOD %s %s:%s%s' % (name, addrport[0], addrport[1], extra))
def getBindAddresses(self):
"""
--
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