[python] __LeaveStreamsUnattached

slush slush at centrum.cz
Sat Dec 6 10:19:08 UTC 2008


>
> use multiple threads (one to do the connect, and one to listen to Tor
> controller events and assign the stream to the circuit)


You are a genius! (An I'm and an idiot because I didn't found this solution
by self!)

I will post final solution after it will works. Currently there is at least
one problem, because after calling attach_stream from another thread (and
Tor returns me SENTCONNECT event), calling of socket.connect() is still
blocking and Tor never send me SUCCEEDED (which I expect as confirmation of
SENTCONNECT). I'm right? What can I do wrong?

Current situation is:

1) Create circuit (main thread) -- OK
2) Call socket.connect() (main thread) -- OK
3) call ctl.attach_stream() from Tor callback handler (it is separate
thread) instead of waiting on stream_id in main thread. It causes to
SENTCONNECT event (with correct stream an circ id), but main thread is still
blocked and Im missing SUCCEEDED event as confirmation...
4) Then, socket.connect() should return socket in main thread, but it never
happen.


Thanks :-)
Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-talk/attachments/20081206/a12c8c32/attachment.htm>


More information about the tor-talk mailing list