aboutsummaryrefslogtreecommitdiff
path: root/src/core/mainloop
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-08-07 10:45:29 -0400
committerNick Mathewson <nickm@torproject.org>2020-08-07 10:45:29 -0400
commit24c721de37d2e10f5c864c2e8001f1468a8a4506 (patch)
tree0d4a57b24e455f1f4cc15c45839c34170b8fdfe7 /src/core/mainloop
parent6fde1548f2eb4551db3652ed59f487b430776d8f (diff)
downloadtor-24c721de37d2e10f5c864c2e8001f1468a8a4506.tar.gz
tor-24c721de37d2e10f5c864c2e8001f1468a8a4506.zip
Log number of inbound/outbound ipv4/6 conns as part of heartbeat
Closes #29113
Diffstat (limited to 'src/core/mainloop')
-rw-r--r--src/core/mainloop/connection.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c
index b89a4ae796..2b926a076c 100644
--- a/src/core/mainloop/connection.c
+++ b/src/core/mainloop/connection.c
@@ -82,6 +82,7 @@
#include "core/or/policies.h"
#include "core/or/reasons.h"
#include "core/or/relay.h"
+#include "core/or/status.h"
#include "core/or/crypt_path.h"
#include "core/proto/proto_haproxy.h"
#include "core/proto/proto_http.h"
@@ -2042,6 +2043,9 @@ connection_handle_listener_read(connection_t *conn, int new_type)
connection_mark_for_close(newconn);
return 0;
}
+
+ note_connection(true /* inbound */, conn->socket_family);
+
return 0;
}
@@ -2213,6 +2217,8 @@ connection_connect_sockaddr,(connection_t *conn,
}
}
+ note_connection(false /* outbound */, conn->socket_family);
+
/* it succeeded. we're connected. */
log_fn(inprogress ? LOG_DEBUG : LOG_INFO, LD_NET,
"Connection to socket %s (sock "TOR_SOCKET_T_FORMAT").",