aboutsummaryrefslogtreecommitdiff
path: root/src/feature/control/control.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2018-11-23 22:50:55 +0100
committerNick Mathewson <nickm@torproject.org>2018-12-17 16:39:28 -0500
commite3ceaebba25127a1d4a3da16e9128ab52491c080 (patch)
tree4031572e1fe7ff60b4845641a4a3cdc385cbcaed /src/feature/control/control.c
parentbfb94dd2ca8e04fb1fe8aba9ad48effbb8b70662 (diff)
downloadtor-e3ceaebba25127a1d4a3da16e9128ab52491c080.tar.gz
tor-e3ceaebba25127a1d4a3da16e9128ab52491c080.zip
Add support for logging messages from pluggable transports.
This patch adds support for the "LOG" protocol message from a pluggable transport. This allows pluggable transport developers to relay log messages from their binary to Tor, which will both emit them as log messages from the Tor process itself, but also pass them on via the control port. See: https://bugs.torproject.org/28180 See: https://bugs.torproject.org/28181 See: https://bugs.torproject.org/28182
Diffstat (limited to 'src/feature/control/control.c')
-rw-r--r--src/feature/control/control.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/feature/control/control.c b/src/feature/control/control.c
index 94679dfd22..b6505a85d6 100644
--- a/src/feature/control/control.c
+++ b/src/feature/control/control.c
@@ -7395,6 +7395,17 @@ control_event_transport_launched(const char *mode, const char *transport_name,
mode, transport_name, fmt_addr(addr), port);
}
+/** A pluggable transport called <b>transport_name</b> has emitted a log
+ * message found in <b>message</b>. */
+void
+control_event_transport_log(const char *transport_name, const char *message)
+{
+ send_control_event(EVENT_TRANSPORT_LOG,
+ "650 TRANSPORT_LOG %s %s\r\n",
+ transport_name,
+ message);
+}
+
/** Convert rendezvous auth type to string for HS_DESC control events
*/
const char *