summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Merge commit '40f7cbc' into bug2812bug2812Damian Johnson2011-06-16
|\ | | | | | | | | Conflicts: TorUtil.py
| * Closing connection in case of auth failurebug3409Damian Johnson2011-06-16
| | | | | | | | | | When authentication failed in TorCtl.connect() the abandoned connection wasn't being closed.
| * TorCtl connect method inflexibleDamian Johnson2011-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Option to get get_network_status as an iteratorbug3406Damian Johnson2011-06-15
| | | | | | | | | | | | | | | | | | | | 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. :(
| * Handling for connections to non-control socketsbug2580Damian Johnson2011-06-13
| | | | | | | | | | | | | | | | | | | | 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.
| * Unblocking waits for a response when we errorbug1329Damian Johnson2011-06-13
| | | | | | | | | | 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.
| * Replacing old TorCtl example with a BW listenerbug2065Damian Johnson2011-06-12
| | | | | | | | | | Event listening, particularly BW events, is a common request on irc so using it as the TorCtl example. For more information see bug 2065.
* | Removing socket timeout for thread wakeupDamian Johnson2011-06-16
|/ | | | | The shutdown added in this branch wakes the socket so there's no need for the loop we previously had.
* Shutting down sockets when closedDamian Johnson2011-06-12
| | | | | Each TorCtl instance spawned a socket that would continue to live for the life of the python process. For more information see ticket 2812.
* Removing indefinite blocking on socket recvbug2412Damian Johnson2011-06-12
| | | | | | 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.
* Fix some issues with SmartSocket.Mike Perry2011-03-07
| | | | Also remove some traceback debugging statements.
* Try to catch an AttributeError early..Mike Perry2011-03-03
| | | | It may be silently killing the bwauths on some platforms..
* Damnit all to hell.Mike Perry2011-02-25
|
* Use isinstance rather than "is type()" for type checks.Mike Perry2011-02-25
|
* Merge remote branch 'chiiph/master'Mike Perry2011-02-25
|\
| * logfile can be unicode tooTomas Touceda2011-02-25
| |
* | Fix a python 2.5 traceback in recent 'body' commit.Mike Perry2011-02-24
| |
* | Merge branch 'chiiph'Mike Perry2011-02-23
|\ \ | |/
| * Add gitignore and status returns set_option(s) and reset_optionsTomas Touceda2011-02-24
| |
* | Add a body field to all events.Mike Perry2011-02-23
|/ | | | Useful to grab the original raw event for debugging/logging.
* Allow outside access to loglevels map.Mike Perry2011-01-30
|
* Add some minimal support for extrainfo documents.Mike Perry2010-12-06
|
* Add LICENSE file and update copyrights.Mike Perry2010-11-18
|
* Demote nickname change log message.Mike Perry2010-11-09
|
* Kill some noisy debug logs.Mike Perry2010-10-05
|
* Only require sqlalchemy if we really need it.Mike Perry2010-10-03
|
* Alter ConsensusTracker to actually track the consensus.Mike Perry2010-09-27
| | | | | | | 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.
* Merge branch 'atagar-connect'Mike Perry2010-08-26
|\
| * Convenience functions for creating and authenticating TorCtl connections.connectAdditionDamian Johnson2010-08-25
| |
* | Fix the Python 2.4 fix.Harry Bock2010-08-25
| | | | | | | | | | Oops - apparently I used a Python 2.5ism in trying to remove a Python 2.5ism :)
* | Fix Python 2.4 compatibility.Harry Bock2010-08-22
|/ | | | | Commit 33bf5a0a4a9 broke python 2.4 compat by using string.partition(), introduced in Python 2.5. Use string.split() instead.
* Obey some laws.Mike Perry2010-08-20
| | | | | Now that copyright infringement is the #1 priority of the FBI, we need to stop doing quite so much of it.
* Fix Tor version regular expression.Harry Bock2010-08-20
| | | | | Need to escape the dot character to get the intended behavior.
* Improve TorCtl descriptor processing speed.Harry Bock2010-08-20
| | | | | | 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.
* Expose status code and message separately in ErrorReply.Harry Bock2010-08-20
| | | | | | | 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.
* Don't ignore unknown exceptions raised by get_router.Harry Bock2010-08-20
| | | | | | | | | 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.
* Implement Python logging support for plog().Harry Bock2010-08-20
| | | | | | | | | | | 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.
* Fix a couple more exceptions.Mike Perry2010-08-10
|
* Spurious len() call..Mike Perry2010-08-10
|
* Add log message for arma's bug..Mike Perry2010-08-10
|
* Develop a better method to wait for consensus.Mike Perry2010-08-10
| | | | | | | 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.
* Hrmm, this should have been DateTime all along..Mike Perry2010-07-14
|
* Add uptime restriction.Mike Perry2010-07-02
|
* Use labels for another Router query...Forgot to set2010-06-23
| | | | | | 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?
* Handle Tor bug #1525: allow new streams to have a non-zero circ id.Mike Perry2010-06-07
|
* Fix IP address regular expression in ExitPolicyLine.__init__Harry Bock2010-05-31
| | | | | | 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.
* Fix determination of netmask from CIDR prefix length.Harry Bock2010-05-31
| | | | | | | | | 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.
* Update README with python TorCtl version.Mike Perry2010-05-30
|
* Update the __all__ list so that BaseSelectionManager shows up in pydoc.mikeperry2010-05-28
| | | | git-svn-id: https://svn.torproject.org/svn/torctl/trunk/python/TorCtl@22439 55e972cd-5a19-0410-ae62-a4d7a52db4cd
* Patch from Harry Bock to eliminate deprecation warnings onmikeperry2010-05-23
| | | | | | | | Python 2.5+. git-svn-id: https://svn.torproject.org/svn/torctl/trunk/python/TorCtl@22379 55e972cd-5a19-0410-ae62-a4d7a52db4cd