QUIC QLOG: Rename QFILTER to OSSL_QFILTER
authorHugo Landau <hlandau@openssl.org>
Mon, 22 Jan 2024 14:41:32 +0000 (14:41 +0000)
committerHugo Landau <hlandau@openssl.org>
Fri, 2 Feb 2024 11:50:03 +0000 (11:50 +0000)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22037)

doc/designs/quic-design/debugging.md
ssl/quic/qlog.c

index 4a29f95c8bef4d1e2011f1c4eac95e9c7576f722..c44ddf2f899dd7578f0ba2673bf00631eef76759 100644 (file)
@@ -49,8 +49,8 @@ To enable QLOG you must:
 - set the environment variable `QLOGDIR` to a directory where QLOG log files
   are to be written;
 
-- set the environment variable `QFILTER` to a filter specifying the events
-  you want to be written (set `QFILTER='*'` for all events).
+- set the environment variable `OSSL_QFILTER` to a filter specifying the events
+  you want to be written (set `OSSL_QFILTER='*'` for all events).
 
 Any process using the libssl QUIC implementation will then automatically write
 QLOG files in the JSON-SEQ format to the specified directory. The files have the
index f374d0c8c77b0e722411321c84868bbff9bc369d..6cf89e355446e67b5d59cc05a8b2fa97bcbb45c8 100644 (file)
@@ -98,7 +98,7 @@ QLOG *ossl_qlog_new_from_env(const QLOG_TRACE_INFO *info)
 {
     QLOG *qlog = NULL;
     const char *qlogdir = ossl_safe_getenv("QLOGDIR");
-    const char *qfilter = ossl_safe_getenv("QFILTER");
+    const char *qfilter = ossl_safe_getenv("OSSL_QFILTER");
     char qlogdir_sep, *filename = NULL;
     size_t i, l, strl;
 
@@ -134,7 +134,10 @@ QLOG *ossl_qlog_new_from_env(const QLOG_TRACE_INFO *info)
     if (!ossl_qlog_set_sink_filename(qlog, filename))
         goto err;
 
-    if (qfilter != NULL && !ossl_qlog_set_filter(qlog, qfilter))
+    if (qfilter == NULL)
+        qfilter = "*";
+
+    if (!ossl_qlog_set_filter(qlog, qfilter))
         goto err;
 
     OPENSSL_free(filename);