aboutsummaryrefslogtreecommitdiff
path: root/src/feature/control/control.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2018-12-20 02:10:42 +0100
committerAlexander Færøy <ahf@torproject.org>2018-12-20 03:41:28 +0100
commit426c52b377057dc5f4428c664ee56ca77d648c9e (patch)
treea222bd78e1f148adb8f52117dc38bc7c0ecb3367 /src/feature/control/control.c
parented0bc85ed0ac765c91def249afa1390bd03cfe85 (diff)
downloadtor-426c52b377057dc5f4428c664ee56ca77d648c9e.tar.gz
tor-426c52b377057dc5f4428c664ee56ca77d648c9e.zip
Use K/V parser to handle LOG messages for pluggable transports.
This patch changes the LOG pluggable transport message to use the recent K/V parser that landed in Tor. This allows PT's to specify the log severity level as well as the message. A mapping between the PT log severity levels and Tor's log serverity level is provided. See: https://bugs.torproject.org/28846
Diffstat (limited to 'src/feature/control/control.c')
-rw-r--r--src/feature/control/control.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/feature/control/control.c b/src/feature/control/control.c
index 7fae3b7a1b..849f11707e 100644
--- a/src/feature/control/control.c
+++ b/src/feature/control/control.c
@@ -7033,15 +7033,14 @@ control_event_transport_launched(const char *mode, const char *transport_name,
mode, transport_name, fmt_addr(addr), port);
}
-/** A pluggable transport called <b>pt_name</b> has emitted a log
- * message found in <b>message</b>. */
+/** A pluggable transport called <b>pt_name</b> has emitted a log message
+ * found in <b>message</b> at <b>severity</b> log level. */
void
-control_event_pt_log(const char *pt_name, const char *message)
+control_event_pt_log(const char *log)
{
send_control_event(EVENT_PT_LOG,
- "650 PT_LOG %s %s\r\n",
- pt_name,
- message);
+ "650 PT_LOG %s\r\n",
+ log);
}
/** Convert rendezvous auth type to string for HS_DESC control events