gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 03/03: MHD_start_daemon(): warn if messages could be pri


From: gnunet
Subject: [libmicrohttpd] 03/03: MHD_start_daemon(): warn if messages could be printed by wrong logger
Date: Mon, 15 Mar 2021 14:38:00 +0100

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit e07c332cea468e03582ee6bd8192968b94b01b6c
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon Mar 15 16:35:07 2021 +0300

    MHD_start_daemon(): warn if messages could be printed by wrong logger
    
    If MHD_OPTION_EXTERNAL_LOGGER is specified and not used in the first
    position then some messages could be printed by standard MHD logger
    before this option is processed. Warn about this situation.
---
 src/include/microhttpd.h | 2 ++
 src/microhttpd/daemon.c  | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 1d44f344..900bfd72 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -1520,6 +1520,8 @@ enum MHD_OPTION
    * a function of type #MHD_LogCallback and the second a pointer
    * `void *` which will be passed as the first argument to the log
    * callback.
+   * Should be specified as the first option, otherwise some messages
+   * may be printed by standard MHD logger during daemon startup.
    *
    * Note that MHD will not generate any log messages
    * if it was compiled without the "--enable-messages"
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 8f548945..535d85aa 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -5741,6 +5741,12 @@ parse_options_va (struct MHD_Daemon *daemon,
                                          VfprintfFunctionPointerType);
       daemon->custom_error_log_cls = va_arg (ap,
                                              void *);
+      if (1 != daemon->num_opts)
+        MHD_DLOG (daemon,
+                  _ ("MHD_OPTION_EXTERNAL_LOGGER is not the first option "
+                     "specified for the daemon. Some messages may be "
+                     "printed by the standard MHD logger.\n"));
+
 #else
       va_arg (ap,
               VfprintfFunctionPointerType);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]