aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
AgeCommit message (Collapse)Author
2015-08-21Merge branch 'workqueue_squashed'Nick Mathewson
2015-08-21Fix a bunch of check-spaces complaintsSebastian Hahn
2015-08-20Rename EVENT_SIGNAL -> EVENT_GOT_SIGNALNick Mathewson
This avoids a conflict with a macro decl from libevent 1.x. Fixes bug 16867; bug not in any released Tor.
2015-08-18Merge branch 'decouple_controller_events_squashed'Nick Mathewson
2015-08-18Use thread-local storage to block event_queue recursion.Nick Mathewson
2015-08-18Multithreading support for event-queue code.Nick Mathewson
2015-08-18Refactor initialization logic for control-event-queueNick Mathewson
This puts the init logic in a separate function, which we will need once we have locking.
2015-08-18Remove obsolete event_format_tNick Mathewson
We used to use this when we had some controllers that would accept long names and some that wouldn't. But it's been obsolete for a while, and it's time to strip it out of the code.
2015-08-18Refactor our logic for sending events to controllersNick Mathewson
Previously we'd put these strings right on the controllers' outbufs. But this could cause some trouble, for these reasons: 1) Calling the network stack directly here would make a huge portion of our networking code (from which so much of the rest of Tor is reachable) reachable from everything that potentially generated controller events. 2) Since _some_ events (EVENT_ERR for instance) would cause us to call connection_flush(), every control_event_* function would appear to be able to reach even _more_ of the network stack in our cllgraph. 3) Every time we generated an event, we'd have to walk the whole connection list, which isn't exactly fast. This is an attempt to break down the "blob" described in http://archives.seul.org/tor/dev/Mar-2015/msg00197.html -- the set of functions from which nearly all the other functions in Tor are reachable. Closes ticket 16695.
2015-08-13Change lost_owning_controller() to call activate_signal().Nick Mathewson
Closes ticket 16788.
2015-08-12Try to decouple process_signal() from anything not event-drivenNick Mathewson
This needs debugging; it currently breaks the stem tests.
2015-07-30Add get_max_sockets() and remove dead codeDavid Goulet
The control port was using set_max_file_descriptors() with a limit set to 0 to query the number of maximum socket Tor can use. With the recent changes to that function, a check was introduced to make sure a user can not set a value below the amount we reserved for non socket. This commit adds get_max_sockets() that returns the value of max_sockets so we can stop using that "setter" function to get the current value. Finally, the dead code is removed that is the code that checked for limit equal to 0. From now on, set_max_file_descriptors() should never be used with a limit set to 0 for a valid use case. Fixes #16697 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-06-03Check for NULL values in getinfo_helper_onionsteor
Fix on 915c7438a77e in Tor 0.2.7.1-alpha.
2015-06-01Appease make check-spacesAndrea Shepard
2015-05-20Add support for 'HiddenServiceMaxStream' to 'ADD_ONION'.Yawning Angel
Done as a separate commit to ease backporting the tunables to 0.2.6.x.
2015-05-18Fix some compilation warningsNick Mathewson
2015-05-18Merge remote-tracking branch 'andrea/ticket15358_squashed_2'Nick Mathewson
2015-05-17Add GETINFO network-liveness to control protocolAndrea Shepard
2015-05-17Implement EVENT_NETWORK_LIVENESSAndrea Shepard
2015-05-14Add missing descriptor ID to HS_DESC control eventDavid Goulet
For FAILED and RECEIVED action of the HS_DESC event, we now sends back the descriptor ID at the end like specified in the control-spec section 4.1.25. Fixes #15881 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-05-08Fix segfault in HSPOST command introduce with feature #3523Donncha O'Cearbhaill
Checking if node->rs->is_hs_dir when the router_status for the node does not exist results in a segfault. This bug is not in any released Tor.
2015-05-05Fix a few more memory leaks; not in any released TorNick Mathewson
2015-05-04Merge branch 'feature3523_027'Nick Mathewson
2015-05-04Add "+HSPOST" and related "HS_DESC" event flags to the controller.Donncha O'Cearbhaill
"+HSPOST" and the related event changes allow the uploading of HS descriptors via the control port, and more comprehensive event monitoring of HS descriptor upload status.
2015-05-02Make `GETINFO hs/client/desc/id/<identifier>` actually work (#14845).Yawning Angel
Not in any released version of tor.
2015-04-30whitespace fixesNick Mathewson
2015-04-30Use rend_data_client/service_create() in codeDavid Goulet
Every callsite that use to allocate a rend_data_t object now use the rend_data_client/service_create() function. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-28Add "ADD_ONION"/"DEL_ONION" and "GETINFO onions/*" to the controller.Yawning Angel
These commands allow for the creation and management of ephemeral Onion ("Hidden") services that are either bound to the lifetime of the originating control connection, or optionally the lifetime of the tor instance. Implements #6411.
2015-04-23Merge remote-tracking branch 'dgoulet/bug14847_027_06'Nick Mathewson
2015-04-23Merge remote-tracking branch 'public/bug15546'Nick Mathewson
2015-04-23Avoid memory leak in error messages in control.c (not in any tor)Nick Mathewson
2015-04-23Merge remote-tracking branch 'dgoulet/bug14845_026_01'Nick Mathewson
2015-04-22Add function to validate HS descriptor IDDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Multiple fixes for the HSFETCH commandDavid Goulet
Ref: https://trac.torproject.org/projects/tor/ticket/14847?replyto=31#comment:31 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Use rend_valid_service_id() in the HSFETCH commandDavid Goulet
Also, fix a small typo in a comment. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Control: make HSFETCH command use LongNameDavid Goulet
The "SERVER=" option now supports LongName described in the control-spec.txt Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Control: add + and 650 OK to HS_DESC_CONTENT eventDavid Goulet
The HS_DESC_CONTENT event results in multiple line thus must be prefixed with a "650+" and ending with "650 OK". Reported-by: Damian Johnson <atagar@torproject.org> Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Control: unbolt rend_data from HS desc eventDavid Goulet
The HS_DESC event was using rend_data_t from the dir connection to reply the onion address and authentication type. With the new HSFETCH command, it's now possible to fetch a descriptor only using the descriptor id thus resulting in not having an onion address in any HS_DESC event. This patch removes rend_query from the hs desc control functions and replace it by an onion address string and an auth type. On a successful fetch, the service id is taken from the fetched descriptor. For that, an extra parameter is added to "store as a client" function that contains the cache entry stored. This will make the control event functions scale more easily over time if other values not present in rend_data_t are needed since the rend_data from the dir connection might not contained everything we need. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Refactor HS descriptor fetch to support descriptor IDDavid Goulet
Big refactor of the HS client descriptor fetch functionnality. This allows to fetch an HS descriptor using only a descriptor ID. Furthermore, it's also possible to provide a list of HSDir(s) now that are used instead of the automatically choosen one. The approach taken was to add a descriptor_id field to the rend_data_t structure so it can be used, if available, by the HS client. The onion address field however has priority over it that is if both are set, the onion address is used to fetch the descriptor. A new public function is introduced called rend_client_fetch_v2_desc(...) that does NOT lookup the client cache before fetching and can take a list of HSDirs as a parameter. The HSFETCH control command now uses this new function thus making it work and final. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Control: add HS_DESC_CONTENT eventDavid Goulet
As defined in section 4.1.26 in the control-spec.txt, this new event replies the content of a successfully fetched HS descriptor. This also adds a unit test for the controller event. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21Control: groud work for the HSFETCH commandDavid Goulet
This adds the command on the controller side that parses and validate arguments but does nothing for now. The HS desriptor fetch must be modularized a bit more before we can use the command. See control-spec.txt section 3.26 for more information on this command. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-15Fix indentation on a blockNick Mathewson
2015-04-15Remove spurious warnNick Mathewson
2015-04-15Merge remote-tracking branch 'sebastian/bug14784'Nick Mathewson
2015-04-15Stop modifying const argument in handle_control_postdescriptorNick Mathewson
Fixes 15546.
2015-03-22Add unit tests for control_event_is_interesting()teor
Part of ticket 15431, checks for bugs similar to 13085.
2015-03-13const-ify the new failure vars, and one old oneNick Mathewson
2015-03-12Don't init control authchallenge nonce as assert side effectSebastian Hahn
Fixes part of bug 15211.
2015-03-04Make boostrap events include hostname ANDaddr AND digestNick Mathewson
2015-02-27Include a HOST item in BOOTSTRAP problem messagesNick Mathewson
Closes ticket 15006.