[tor-commits] [goptlib/master] Add SmethodArgs to emit SMETHOD with ARGS.

dcf at torproject.org dcf at torproject.org
Mon Dec 9 02:49:51 UTC 2013


commit af41f2c1074ad73bde5b326083d2511b30924793
Author: David Fifield <david at bamsoftware.com>
Date:   Sun Dec 8 03:03:12 2013 -0800

    Add SmethodArgs to emit SMETHOD with ARGS.
---
 pt.go |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pt.go b/pt.go
index 18c3b73..4f7f167 100644
--- a/pt.go
+++ b/pt.go
@@ -259,6 +259,12 @@ func Smethod(name string, addr net.Addr) {
 	line("SMETHOD", name, addr.String())
 }
 
+// Emit an SMETHOD line with an ARGS option. args is a name–value mapping that
+// will be added to the server's extrainfo document.
+func SmethodArgs(name string, addr net.Addr, args Args) {
+	line("SMETHOD", name, addr.String(), "ARGS:"+encodeSmethodArgs(args))
+}
+
 // Emit an SMETHODS DONE line. Call this after opening all server listeners.
 func SmethodsDone() {
 	line("SMETHODS", "DONE")





More information about the tor-commits mailing list