[or-cvs] a tor-control patch to do setconf too

Roger Dingledine arma at seul.org
Tue Nov 9 05:45:43 UTC 2004


Update of /home/or/cvsroot/contrib
In directory moria.mit.edu:/home2/arma/work/onion/cvs/contrib

Modified Files:
	tor-control.py 
Log Message:
a tor-control patch to do setconf too


Index: tor-control.py
===================================================================
RCS file: /home/or/cvsroot/contrib/tor-control.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- tor-control.py	9 Nov 2004 01:34:18 -0000	1.2
+++ tor-control.py	9 Nov 2004 05:45:41 -0000	1.3
@@ -52,12 +52,18 @@
   length,type,body = receive_message(s)
   return
 
+def set_option(s,msg):
+  s.sendall(pack_message(MSG_TYPE_SETCONF,msg))
+  length,type,body = receive_message(s)
+  return
+
 def do_main_loop(host,port):
   print "host is %s:%d"%(host,port)
   s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
   s.connect((host,port))
   authenticate(s)
   get_option(s,"nickname")
+  set_option(s,"runasdaemon 1")
 #  get_option(s,"DirFetchPostPeriod\n")
 
   return



More information about the tor-commits mailing list