[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] allow redirect_stream to rewrite the port



Update of /home/or/cvsroot/control/python
In directory moria:/tmp/cvs-serv13977

Modified Files:
	TorCtl1.py 
Log Message:
allow redirect_stream to rewrite the port


Index: TorCtl1.py
===================================================================
RCS file: /home/or/cvsroot/control/python/TorCtl1.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -p -d -r1.24 -r1.25
--- TorCtl1.py	1 Dec 2005 07:06:37 -0000	1.24
+++ TorCtl1.py	22 Dec 2005 03:35:15 -0000	1.25
@@ -312,9 +312,12 @@ class Connection(TorCtl._ConnectionBase)
             raise TorCtl.ProtocolError("Bad extended line %r",msg)
         return m.group(1)
 
-    def redirect_stream(self, streamid, newtarget):
+    def redirect_stream(self, streamid, newaddr, newport=""):
         """DOCDOC"""
-        self._sendAndRecv("REDIRECTSTREAM %s %s\r\n"%(streamid, newtarget))
+        if newport:
+            self._sendAndRecv("REDIRECTSTREAM %s %s %s\r\n"%(streamid, newtarget, newport))
+        else:
+            self._sendAndRecv("REDIRECTSTREAM %s %s\r\n"%(streamid, newtarget))
 
     def attach_stream(self, streamid, circid):
         """DOCDOC"""