diff options
author | Alexander Færøy <ahf@torproject.org> | 2018-11-23 22:50:55 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-12-17 16:39:28 -0500 |
commit | e3ceaebba25127a1d4a3da16e9128ab52491c080 (patch) | |
tree | 4031572e1fe7ff60b4845641a4a3cdc385cbcaed /src/feature/control/control.c | |
parent | bfb94dd2ca8e04fb1fe8aba9ad48effbb8b70662 (diff) | |
download | tor-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.c | 11 |
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 * |