aboutsummaryrefslogtreecommitdiff
path: root/src/feature/control
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-10-20 10:57:24 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-10-27 10:43:42 -0400
commit4f5cea1f592d9e9e6c69fc0e772dd46a0fa43799 (patch)
treead94055219fcf1db9f0445f584283a5af397ef00 /src/feature/control
parenta882d1bf0abbbcf2bc4f8c039f9b82262462292c (diff)
downloadtor-4f5cea1f592d9e9e6c69fc0e772dd46a0fa43799.tar.gz
tor-4f5cea1f592d9e9e6c69fc0e772dd46a0fa43799.zip
conn: New Metrics listener port
If MetricsPort is defined, listen on it and handle the incoming request. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/control')
-rw-r--r--src/feature/control/control_fmt.c2
-rw-r--r--src/feature/control/control_getinfo.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/feature/control/control_fmt.c b/src/feature/control/control_fmt.c
index d76e6ad8dd..014427c5b5 100644
--- a/src/feature/control/control_fmt.c
+++ b/src/feature/control/control_fmt.c
@@ -206,6 +206,8 @@ entry_connection_describe_status_for_controller(const entry_connection_t *conn)
case CONN_TYPE_AP_DNS_LISTENER: client_protocol = "DNS"; break;
case CONN_TYPE_AP_HTTP_CONNECT_LISTENER:
client_protocol = "HTTPCONNECT"; break;
+ case CONN_TYPE_METRICS_LISTENER:
+ client_protocol = "METRICS"; break;
default: client_protocol = "UNKNOWN";
}
smartlist_add_asprintf(descparts, "CLIENT_PROTOCOL=%s",
diff --git a/src/feature/control/control_getinfo.c b/src/feature/control/control_getinfo.c
index 461b8eeb94..cfac59d499 100644
--- a/src/feature/control/control_getinfo.c
+++ b/src/feature/control/control_getinfo.c
@@ -287,6 +287,8 @@ getinfo_helper_listeners(control_connection_t *control_conn,
type = CONN_TYPE_AP_DNS_LISTENER;
else if (!strcmp(question, "net/listeners/control"))
type = CONN_TYPE_CONTROL_LISTENER;
+ else if (!strcmp(question, "net/listeners/metrics"))
+ type = CONN_TYPE_METRICS_LISTENER;
else
return 0; /* unknown key */