aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/connection_edge.c
diff options
context:
space:
mode:
authorNeel Chauhan <neel@neelc.org>2021-01-19 14:51:00 -0800
committerNick Mathewson <nickm@torproject.org>2021-02-08 10:23:41 -0500
commit2391c60c5c89b104572323a439e3560a09c1a6e2 (patch)
tree09374510094b2f87717c1535272db4409474deea /src/core/or/connection_edge.c
parentb0af4ddc7c2fe80a79e41e31b7050d949561e044 (diff)
downloadtor-2391c60c5c89b104572323a439e3560a09c1a6e2.tar.gz
tor-2391c60c5c89b104572323a439e3560a09c1a6e2.zip
Add stream ID to ADDRMAP control event
Diffstat (limited to 'src/core/or/connection_edge.c')
-rw-r--r--src/core/or/connection_edge.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c
index b2390e4f04..e605b5f4e1 100644
--- a/src/core/or/connection_edge.c
+++ b/src/core/or/connection_edge.c
@@ -3519,22 +3519,28 @@ tell_controller_about_resolved_result(entry_connection_t *conn,
int ttl,
time_t expires)
{
+ uint64_t stream_id = 0;
+
+ if (conn) {
+ stream_id = ENTRY_TO_CONN(conn)->global_identifier;
+ }
+
expires = time(NULL) + ttl;
if (answer_type == RESOLVED_TYPE_IPV4 && answer_len >= 4) {
char *cp = tor_dup_ip(ntohl(get_uint32(answer)));
if (cp)
control_event_address_mapped(conn->socks_request->address,
- cp, expires, NULL, 0);
+ cp, expires, NULL, 0, stream_id);
tor_free(cp);
} else if (answer_type == RESOLVED_TYPE_HOSTNAME && answer_len < 256) {
char *cp = tor_strndup(answer, answer_len);
control_event_address_mapped(conn->socks_request->address,
- cp, expires, NULL, 0);
+ cp, expires, NULL, 0, stream_id);
tor_free(cp);
} else {
control_event_address_mapped(conn->socks_request->address,
"<error>", time(NULL)+ttl,
- "error=yes", 0);
+ "error=yes", 0, stream_id);
}
}