[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r1282: Add a method for closing a stream, too. (trunk/src/control)
Author: edmanm
Date: 2006-10-04 15:41:48 -0400 (Wed, 04 Oct 2006)
New Revision: 1282
Modified:
trunk/src/control/torcontrol.cpp
trunk/src/control/torcontrol.h
Log:
Add a method for closing a stream, too.
Modified: trunk/src/control/torcontrol.cpp
===================================================================
--- trunk/src/control/torcontrol.cpp 2006-10-04 15:39:28 UTC (rev 1281)
+++ trunk/src/control/torcontrol.cpp 2006-10-04 19:41:48 UTC (rev 1282)
@@ -778,3 +778,12 @@
return streams;
}
+/** Closes the stream specified by <b>streamid</b>. */
+bool
+TorControl::closeStream(quint64 streamid, QString *errmsg)
+{
+ ControlCommand cmd("CLOSESTREAM", QString::number(streamid));
+ cmd.addArgument("1"); /* 1 == REASON_MISC (tor-spec.txt) */
+ return send(cmd, errmsg);
+}
+
Modified: trunk/src/control/torcontrol.h
===================================================================
--- trunk/src/control/torcontrol.h 2006-10-04 15:39:28 UTC (rev 1281)
+++ trunk/src/control/torcontrol.h 2006-10-04 19:41:48 UTC (rev 1282)
@@ -127,6 +127,8 @@
/** Closes the circuit specified by <b>circid</b>. If <b>ifUnused</b> is
* true, then the circuit will not be closed unless it is unused. */
bool closeCircuit(quint64 circid, bool ifUnused = false, QString *errmsg = 0);
+ /** Closes the stream specified by <b>streamid</b>. */
+ bool closeStream(quint64 streamid, QString *errmsg = 0);
signals:
/** Emitted when the Tor process has started */