summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2021-02-19 13:26:33 +0200
committerGeorge Kadianakis <desnacked@riseup.net>2021-02-19 13:26:33 +0200
commit03c686563b54bbdf1337cb047b2b6002c5a1a549 (patch)
tree336c94df1791bfe0c4134fb2f313477d8c24fc63
parentaebd0a4080559a5c24e580ddf50e5b5c8ff1cc29 (diff)
parent9f61d9238ce81444b988137508436255f275051d (diff)
downloadtor-03c686563b54bbdf1337cb047b2b6002c5a1a549.tar.gz
tor-03c686563b54bbdf1337cb047b2b6002c5a1a549.zip
Merge remote-tracking branch 'tor-gitlab/mr/308' into maint-0.4.5
-rw-r--r--changes/ticket402953
-rw-r--r--src/core/mainloop/connection.c2
-rw-r--r--src/feature/metrics/metrics.c9
-rw-r--r--src/feature/metrics/metrics.h1
4 files changed, 15 insertions, 0 deletions
diff --git a/changes/ticket40295 b/changes/ticket40295
new file mode 100644
index 0000000000..e6dba80120
--- /dev/null
+++ b/changes/ticket40295
@@ -0,0 +1,3 @@
+ o Minor bugfixes (metrics port):
+ - Fix a BUG() on the MetricsPort for an internal missing handler. Fixes bug
+ 40295; bugfix on 0.4.5.1-alpha.
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c
index 85cdec6e1e..ada542629a 100644
--- a/src/core/mainloop/connection.c
+++ b/src/core/mainloop/connection.c
@@ -5187,6 +5187,8 @@ connection_finished_flushing(connection_t *conn)
return connection_dir_finished_flushing(TO_DIR_CONN(conn));
case CONN_TYPE_CONTROL:
return connection_control_finished_flushing(TO_CONTROL_CONN(conn));
+ case CONN_TYPE_METRICS:
+ return metrics_connection_finished_flushing(conn);
default:
log_err(LD_BUG,"got unexpected conn type %d.", conn->type);
tor_fragile_assert();
diff --git a/src/feature/metrics/metrics.c b/src/feature/metrics/metrics.c
index 7a77ab1104..9a72fe7145 100644
--- a/src/feature/metrics/metrics.c
+++ b/src/feature/metrics/metrics.c
@@ -258,6 +258,15 @@ metrics_connection_reached_eof(connection_t *conn)
return 0;
}
+/** Called when conn has no more bytes left on its outbuf. Return 0 indicating
+ * success. */
+int
+metrics_connection_finished_flushing(connection_t *conn)
+{
+ tor_assert(conn);
+ return 0;
+}
+
/** Initialize the subsystem. */
void
metrics_init(void)
diff --git a/src/feature/metrics/metrics.h b/src/feature/metrics/metrics.h
index 858722de59..e072519d10 100644
--- a/src/feature/metrics/metrics.h
+++ b/src/feature/metrics/metrics.h
@@ -28,6 +28,7 @@ buf_t *metrics_get_output(const metrics_format_t fmt);
/* Connection. */
int metrics_connection_process_inbuf(struct connection_t *conn);
int metrics_connection_reached_eof(struct connection_t *conn);
+int metrics_connection_finished_flushing(struct connection_t *conn);
/* Configuration. */
int metrics_parse_ports(or_options_t *options, smartlist_t *ports,