mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Only use optimistic data with exits that support it
This adds a little code complexity: we need to remember for each node whether it supports the right feature, and then check for each connection whether it's exiting at such a node. We store this in a flag in the edge_connection_t, and set that flag at link time.
This commit is contained in:
@@ -1232,6 +1232,11 @@ typedef struct edge_connection_t {
|
||||
* NATd connection */
|
||||
unsigned int is_transparent_ap:1;
|
||||
|
||||
/** Set if this connection's target exit node allows optimistic data.
|
||||
* (That is, data sent on this stream before the exit has sent a
|
||||
* CONNECTED cell.)*/
|
||||
unsigned int exit_allows_optimistic_data : 1;
|
||||
|
||||
/** If this is a DNSPort connection, this field holds the pending DNS
|
||||
* request that we're going to try to answer. */
|
||||
struct evdns_server_request *dns_server_request;
|
||||
@@ -1667,6 +1672,9 @@ typedef struct routerstatus_t {
|
||||
/** True iff this router is a version that, if it caches directory info,
|
||||
* we can get microdescriptors from. */
|
||||
unsigned int version_supports_microdesc_cache:1;
|
||||
/** True iff this router is a version that allows DATA cells to arrive on
|
||||
* a stream before it has sent a CONNECTED cell. */
|
||||
unsigned int version_supports_optimistic_data:1;
|
||||
|
||||
unsigned int has_bandwidth:1; /**< The vote/consensus had bw info */
|
||||
unsigned int has_exitsummary:1; /**< The vote/consensus had exit summaries */
|
||||
|
||||
Reference in New Issue
Block a user