mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Use the new guard notification/selection APIs throughout Tor
This patch doesn't cover every case; omitted cases are marked with "XXXX prop271", as usual. It leaves both the old interface and the new interface for guard status notification, since they don't actually work in the same way: the new API wants to be told when a circuit has failed or succeeded, whereas the old API wants to know when a channel has failed or succeeded. I ran into some trouble with directory guard stuff, since when we pick the directory guard, we don't actually have a circuit to associate it with. I solved that by allowing guard states to be associated with directory connections, not just circuits.
This commit is contained in:
+6
-2
@@ -23,6 +23,7 @@
|
||||
#include "directory.h"
|
||||
#include "dirserv.h"
|
||||
#include "dirvote.h"
|
||||
#include "entrynodes.h"
|
||||
#include "hibernate.h"
|
||||
#include "memarea.h"
|
||||
#include "networkstatus.h"
|
||||
@@ -4397,7 +4398,8 @@ directory_initiate_command_routerstatus, (const routerstatus_t *status,
|
||||
const char *resource,
|
||||
const char *payload,
|
||||
size_t payload_len,
|
||||
time_t if_modified_since));
|
||||
time_t if_modified_since,
|
||||
circuit_guard_state_t *guardstate));
|
||||
|
||||
static void
|
||||
test_dir_should_not_init_request_to_ourselves(void *data)
|
||||
@@ -4504,7 +4506,8 @@ NS(directory_initiate_command_routerstatus)(const routerstatus_t *status,
|
||||
const char *resource,
|
||||
const char *payload,
|
||||
size_t payload_len,
|
||||
time_t if_modified_since)
|
||||
time_t if_modified_since,
|
||||
circuit_guard_state_t *guardstate)
|
||||
{
|
||||
(void)status;
|
||||
(void)dir_purpose;
|
||||
@@ -4514,6 +4517,7 @@ NS(directory_initiate_command_routerstatus)(const routerstatus_t *status,
|
||||
(void)payload;
|
||||
(void)payload_len;
|
||||
(void)if_modified_since;
|
||||
(void)guardstate;
|
||||
CALLED(directory_initiate_command_routerstatus)++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user