[tor-dev] [tor-talk] Open streams on the fly

benjaminlincoln at lavabit.com benjaminlincoln at lavabit.com
Sat Jan 19 22:13:57 UTC 2013

>> The implementation of proposal 171 and subsequent release of tor
>> fills my heart with joy. Yet, as far as I can tell, there is one use
>> case
>> that is not adequately covered. I would like to open and close Streams
>> (TransPort's, DNSPort's and SOCKSPort's) at run-time without interfering
>> with other, existing Streams and Circuits.  SETCONF does not work here
>> because it resets all existing streams.
> I think tor lacks an isolation flag which specifies to isolate each and
> every stream, even those going to the same address and port.

I see, tor already implements such a flag, ISO_STREAM.

/** Isolate based on destination port */
#define ISO_DESTPORT    (1u<<0)
/** Isolate based on destination address */
/** Isolate all streams (Internal only). */
#define ISO_STREAM      (1u<<7)

diff --git a/src/or/config.c b/src/or/config.c
index 90a5dfb..648bfba 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -5929,6 +5929,8 @@ parse_port_config(smartlist_t *out,
           isoflag = ISO_CLIENTPROTO;
         } else if (!strcasecmp(elt, "IsolateClientAddr")) {
           isoflag = ISO_CLIENTADDR;
+	} else if (!strcasecmp(elt, "IsolateStream")) {
+          isoflag = ISO_STREAM;
         } else {
           log_warn(LD_CONFIG, "Unrecognized %sPort option '%s'",
                    portname, escaped(elt_orig));

This looks like a reasonable addition to me - an addition that could be
backported to 0.2.3.x.

More information about the tor-dev mailing list