summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-01-27 09:34:34 -0500
committerNick Mathewson <nickm@torproject.org>2021-02-08 14:26:45 -0500
commit01c4abc2d41a7d140a0c0931528fc680dcbac0ee (patch)
tree3d3eb1c42f7370f18af1f9e738976d5f960a76ad /src/core
parentf420eacf1858220f1cb284353f975e03464b15e4 (diff)
downloadtor-01c4abc2d41a7d140a0c0931528fc680dcbac0ee.tar.gz
tor-01c4abc2d41a7d140a0c0931528fc680dcbac0ee.zip
conn: Properly close MetricsPort socket on EOF
Handle the EOF situation for a metrics connection. Furthermore, if we failed to fetch the data from the inbuf properly, mark the socket as closed because the caller, connection_process_inbuf(), assumes that we did so on error. Fixes #40257 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/mainloop/connection.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c
index 3d551c4ba8..85cdec6e1e 100644
--- a/src/core/mainloop/connection.c
+++ b/src/core/mainloop/connection.c
@@ -5242,6 +5242,8 @@ connection_reached_eof(connection_t *conn)
return connection_dir_reached_eof(TO_DIR_CONN(conn));
case CONN_TYPE_CONTROL:
return connection_control_reached_eof(TO_CONTROL_CONN(conn));
+ case CONN_TYPE_METRICS:
+ return metrics_connection_reached_eof(conn);
default:
log_err(LD_BUG,"got unexpected conn type %d.", conn->type);
tor_fragile_assert();