| Commit message (Collapse) | Author | Age |
| |
|
|
|
| |
When authentication failed in TorCtl.connect() the abandoned connection wasn't
being closed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The connect method is a nice helper for cli initiation, but lacks sufficient
call visibility to help in more general use cases. In particular it...
- sends feedback to stdout
- prompts for the controller password on stdin
- suppresses exceptions
To get around this I'm adding a more generic 'connectionComp' that does the
icky bits of the connection negotiation I was trying to hide while still giving
the caller what it needs to handle the connection process however it'd like.
Tested by exercising the connect functionality with cookies, password, and
connection components to handle my TBB cookie auth renegotiation fix.
|
| |
|
|
|
|
|
|
|
|
| |
Setting the 'getIterator' argument drops the memory usage of calling
get_network_status by 71% (from 3.5 MB to 1 MB). This is still higher than what
I was expecting from a generator, though certainly much better.
Unfortunately this didn't have an impact on the ConsensusTracker. The memory
usage from its constructor dwarfs anything else I've looked at (18.8 MB) and
didn't drop like I'd expect when consensus_only was false. :(
|
| |
|
|
|
|
|
|
|
|
| |
When we attempt to initiate a control connection to a non-control port (for
instance tor's socks port instead)...
- the socket shutdown issues an error since it's not connected yet
- checking the authentication type fails with a TorCtlClosed rather than error
reply
For more information see bug 2580.
|
| |
|
|
|
| |
When the signal sent by _sendImpl causes the control connection to close we
block indefinitely waiting for a response. For more information see bug 1329.
|
| |
|
|
|
| |
Event listening, particularly BW events, is a common request on irc so using it
as the TorCtl example. For more information see bug 2065.
|
| |
|
|
|
| |
Each TorCtl instance spawned a socket that would continue to live for the life
of the python process. For more information see ticket 2812.
|
| |
|
|
|
|
| |
When shutting down we can't join on _thread unless the socket receives data
because we didn't have a timeout. This issues a 20 ms timeout on socket reads
and cleans up _thread when we close.
|
| |
|
|
| |
Also remove some traceback debugging statements.
|
| |
|
|
| |
It may be silently killing the bwauths on some platforms..
|
| | |
|
| | |
|
| |\ |
|
| | | |
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|
| |/
|
|
| |
Useful to grab the original raw event for debugging/logging.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
It was tracking the Tor client's notion of the consensus, in a poor way. It
now can do one or the other, depending on constructor option.
Also, add some APIs that are helpful for torperf.
|
| |\ |
|
| | | |
|
| | |
| |
| |
| |
| | |
Oops - apparently I used a Python 2.5ism in trying to remove a
Python 2.5ism :)
|
| |/
|
|
|
| |
Commit 33bf5a0a4a9 broke python 2.4 compat by using string.partition(),
introduced in Python 2.5. Use string.split() instead.
|
| |
|
|
|
| |
Now that copyright infringement is the #1 priority of the FBI,
we need to stop doing quite so much of it.
|
| |
|
|
|
| |
Need to escape the dot character to get the intended
behavior.
|
| |
|
|
|
|
| |
By only running one regular expression per descriptor line and
performing a slightly better way of checking which line type
we're handling, we cut the run time of build_from_desc in half.
|
| |
|
|
|
|
|
| |
Allow callers to handle a specific status code as an integer as well as
the associated message within an ErrorReply exception. Should be API-compatible
as the associated keyword arguments are popped from the **kwarg dict before
being passed to the parent exception class.
|
| |
|
|
|
|
|
|
|
| |
If an unknown exception is raised on one NS document during
read_routers, it's very likely it's going to be raised again on the
next, and the next... (e.g., TorCtlClosed).
Instead of printing out the traceback and continuing, allow it to
unwind the stack and let the caller handle it.
|
| |
|
|
|
|
|
|
|
|
|
| |
This patch converts plog() to map to Python's logging module without
changing API compatibility. If an application wishes to integrate
its own Python logger with TorCtl, it can call TorUtil.plog_use_logger
with the name of the desired logger. Otherwise, TorUtil will create
its own logger that retains its original log format and emission behavior.
This patch retains the standard plog() loglevels and maps them to
logging constants where appropriate.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Do not return from wait_for_consensus unless we have at least 95% of all of
our router descriptors.
Also, sanity check that we aren't storing waay too many router descriptors.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
I should really figure out why this is happening, and which other queries
might need this... SQLAlchemy said we needed it on this line (in some rare
case - not always). Possible SQLAlchemy bug/corruption?
|
| | |
|
| |
|
|
|
|
| |
Previous expression "\d+.\d+.\d+.\d+" matches many many things which are
probably not intended. Use "(\d{1,3}\.){3}\d{1,3}$" instead and compile it for
efficiency.
|
| |
|
|
|
|
|
|
|
| |
ExitPolicyLine parses IP/netmask combinations and supports CIDR notation.
The previous method for calculating an IPv4 netmask from a CIDR prefix length
causes the result to exceed 32 bits, but the result is never truncated,
causing a DeprecationWarning on 64-bit platforms when the integer is packed.
Use a better method for the calculation that always fits in 32 bits.
|
| | |
|
| |
|
|
| |
git-svn-id: https://svn.torproject.org/svn/torctl/trunk/python/TorCtl@22439 55e972cd-5a19-0410-ae62-a4d7a52db4cd
|
| |
|
|
|
|
|
|
| |
Python 2.5+.
git-svn-id: https://svn.torproject.org/svn/torctl/trunk/python/TorCtl@22379 55e972cd-5a19-0410-ae62-a4d7a52db4cd
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
this provides a more reliable indication as to when we are
done processing events on the connection.
For some reason python's socket.close() does not cause a
concurrent blocking readline() to return immediately.. This
prevents the 'TorThread' (the _loop() thread) from
terminating until more data arrives.
git-svn-id: https://svn.torproject.org/svn/torctl/trunk/python/TorCtl@22378 55e972cd-5a19-0410-ae62-a4d7a52db4cd
|
| |
|
|
|
|
|
|
|
| |
track down a rare bw authority stall bug that may be related
to excessive server load/queue delay.
git-svn-id: https://svn.torproject.org/svn/torctl/trunk/python/TorCtl@22376 55e972cd-5a19-0410-ae62-a4d7a52db4cd
|