summaryrefslogtreecommitdiff
path: root/src/or/control.c
AgeCommit message (Collapse)Author
2016-05-02(cherry-picked by nickm, with changes file from isis.)s0rlxmh0
2016-03-28Fix memory leak in TestingEnableCellStatsEventNick Mathewson
Only when we were actually flushing the cell stats to a controller would we free them. Thus, they could stay in RAM even after the circuit was freed (eg if we didn't have any controllers). Fixes bug 18673; bugfix on 0.2.5.1-alpha.
2016-02-27Update the copyright year.Nick Mathewson
2016-02-17Add onion address to the HS_DESC UPLOADED eventDavid Goulet
Fixes #16023 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2016-01-29Return NULL from extend_info_from_node if the node has no allowed addressteor (Tim Wilson-Brown)
Modify callers to correctly handle these new NULL returns: * fix assert in onion_extend_cpath * warn and discard circuit in circuit_get_open_circ_or_launch * warn, discard circuit, and tell controller in handle_control_extendcircuit
2015-12-15Replace usage of INLINE with inlinecypherpunks
This patch was generated using; sed -i -e "s/\bINLINE\b/inline/" src/*/*.[ch] src/*/*/*.[ch]
2015-11-27More fixes/debugging attempts for 17659Nick Mathewson
2015-11-25Merge branch 'bug17686_v2_027'Nick Mathewson
2015-11-25Now that crypto_rand() cannot fail, it should return void.Nick Mathewson
2015-11-20Add controller getinfo exit-policy/reject-privateteor (Tim Wilson-Brown)
exit-policy/reject-private lists the reject rules added by ExitPolicyRejectPrivate. This makes it easier for stem to display exit policies. Add unit tests for getinfo exit-policy/*. Completes ticket #17183. Patch by "teor".
2015-09-08Separate lookup function for service rend cacheDonncha O'Cearbhaill
Performing lookups in both the client and service side descriptor caches from the same rend_cache_lookup_entry() function increases the risk of accidental API misuse. I'm separating the lookup functions to keep the caches distinct.
2015-09-08Add replica number to HS_DESC CREATED eventDonncha O'Cearbhaill
Including the replica number in the HS_DESC CREATED event provides more context to a control port client. The replica allows clients to more easily identify each replicated descriptor from the independantly output control events.
2015-09-08Specify descriptor cache type in rend_cache_lookup_entry()Donncha O'Cearbhaill
Adds an Enum which represents the different types of rendezvous descriptor caches. This argument is passed in each call to rend_cache_lookup_entry() to specify lookup in the client-side or service-side descriptor caches.
2015-09-08Add GETINFO hs/service/desc/id/ control commandDonncha O'Cearbhaill
Adds a control command to fetch a local service descriptor from the service descriptor cache. The local service descriptor cache is referenced by the onion address of the service. This control command is documented in the control spec.
2015-08-25Add a HS_DESC CREATED control eventDonncha O'Cearbhaill
The HS_DESC CREATED event should be emmited when a new service descriptor is generated for a local rendevous service. This event is documented in the control spec. This commit resolves ticket #16291.
2015-08-25Create a service-side descriptor cacheDonncha O'Cearbhaill
Adds a service descriptor cache which is indexed by service ID. This descriptor cache is used to store service descriptors generated by a local rendevous service. The service-side cach can be queried by calling rend_cache_lookup_entry() with the 'service' argument set to 1.
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>