diff options
author | David Goulet <dgoulet@torproject.org> | 2018-01-30 09:33:12 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2018-01-30 09:33:12 -0500 |
commit | cd81403cc0d73d53cb7f3650b38d49c54100af25 (patch) | |
tree | 5ea4f0c626ad082fb195a478614f67dff1a7b386 /src/or/channel.c | |
parent | 03ab24b44cd148263cfb2b801cba35489e3852c1 (diff) | |
parent | 9aca7d47306222f2870ec16a7291a8215d6c3316 (diff) | |
download | tor-cd81403cc0d73d53cb7f3650b38d49c54100af25.tar.gz tor-cd81403cc0d73d53cb7f3650b38d49c54100af25.zip |
Merge branch 'ticket24902_029_05' into ticket24902_033_02
Diffstat (limited to 'src/or/channel.c')
-rw-r--r-- | src/or/channel.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/channel.c b/src/or/channel.c index 345a90a004..094bf93e66 100644 --- a/src/or/channel.c +++ b/src/or/channel.c @@ -1888,6 +1888,7 @@ channel_do_open_actions(channel_t *chan) if (!connection_or_digest_is_known_relay(chan->identity_digest)) { if (channel_get_addr_if_possible(chan, &remote_addr)) { char *transport_name = NULL; + channel_tls_t *tlschan = BASE_CHAN_TO_TLS(chan); if (chan->get_transport_name(chan, &transport_name) < 0) transport_name = NULL; @@ -1895,6 +1896,10 @@ channel_do_open_actions(channel_t *chan) &remote_addr, transport_name, now); tor_free(transport_name); + /* Notify the DoS subsystem of a new client. */ + if (tlschan && tlschan->conn) { + dos_new_client_conn(tlschan->conn); + } } /* Otherwise the underlying transport can't tell us this, so skip it */ } @@ -2914,8 +2919,8 @@ channel_get_canonical_remote_descr(channel_t *chan) * supports this operation, and return 1. Return 0 if the underlying transport * doesn't let us do this. */ -int -channel_get_addr_if_possible(channel_t *chan, tor_addr_t *addr_out) +MOCK_IMPL(int, +channel_get_addr_if_possible,(channel_t *chan, tor_addr_t *addr_out)) { tor_assert(chan); tor_assert(addr_out); |