diff options
author | George Kadianakis <desnacked@riseup.net> | 2020-10-20 13:26:19 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2020-10-20 13:26:19 +0300 |
commit | 19302a1dfd8da73ff86b0c36534221b71c501c32 (patch) | |
tree | 22fab1d6f4fbc963a0c263b2ea19357a92efdea5 /src/core/or/channeltls.c | |
parent | f7adf3653ff313d45d70bed7c0fdcdd0d64f29ab (diff) | |
parent | cb4cedae686bd227d42997840b3a6b0b3bc5e936 (diff) | |
download | tor-19302a1dfd8da73ff86b0c36534221b71c501c32.tar.gz tor-19302a1dfd8da73ff86b0c36534221b71c501c32.zip |
Merge remote-tracking branch 'tor-gitlab/mr/148' into master
Diffstat (limited to 'src/core/or/channeltls.c')
-rw-r--r-- | src/core/or/channeltls.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/or/channeltls.c b/src/core/or/channeltls.c index a0debf8d22..32723fed1e 100644 --- a/src/core/or/channeltls.c +++ b/src/core/or/channeltls.c @@ -360,6 +360,31 @@ channel_tls_handle_incoming(or_connection_t *orconn) return chan; } +/** + * Set the `potentially_used_for_bootstrapping` flag on the or_connection_t + * corresponding to the provided channel. + * + * This flag indicates that if the connection fails, it might be interesting + * to the bootstrapping subsystem. (The bootstrapping system only cares about + * channels that we have tried to use for our own circuits. Other channels + * may have been launched in response to EXTEND cells from somebody else, and + * if they fail, it won't necessarily indicate a bootstrapping problem.) + **/ +void +channel_mark_as_used_for_origin_circuit(channel_t *chan) +{ + if (BUG(!chan)) + return; + if (chan->magic != TLS_CHAN_MAGIC) + return; + channel_tls_t *tlschan = channel_tls_from_base(chan); + if (BUG(!tlschan)) + return; + + if (tlschan->conn) + tlschan->conn->potentially_used_for_bootstrapping = 1; +} + /********* * Casts * ********/ |