[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r10384 - libmicrohttpd/src/daemon
From: |
gnunet |
Subject: |
[GNUnet-SVN] r10384 - libmicrohttpd/src/daemon |
Date: |
Sat, 20 Feb 2010 10:00:45 +0100 |
Author: grothoff
Date: 2010-02-20 10:00:45 +0100 (Sat, 20 Feb 2010)
New Revision: 10384
Modified:
libmicrohttpd/src/daemon/daemon.c
Log:
Fixing issue mentioned below.
From:
Jesse Anderton <address@hidden>
To:
Christian Grothoff <address@hidden>
Date:
Yesterday 11:50:56 pm
Christian,
I'm not sure whether this counts as a bug or not, but I found that if you
use MHD_OPTION_CIPHER_ALGORITHM or MHD_OPTION_PROTOCOL_VERSION in
MHD_start_daemon() without using MHD_USE_SSL a SIGSEGV will result. This
signal is sent because the daemon's priority_cache member is dereferenced
in MHD_start_daemon_va(), but this member is only initialized if MHD_USE_SSL
is used.
This doesn't affect me: a workaround is easy. I just wanted to make sure
you were aware of it.
Regards,
Jesse
Modified: libmicrohttpd/src/daemon/daemon.c
===================================================================
--- libmicrohttpd/src/daemon/daemon.c 2010-02-19 19:41:06 UTC (rev 10383)
+++ libmicrohttpd/src/daemon/daemon.c 2010-02-20 09:00:45 UTC (rev 10384)
@@ -1248,18 +1248,46 @@
break;
#if HTTPS_SUPPORT
case MHD_OPTION_PROTOCOL_VERSION:
- _set_priority (&daemon->priority_cache->protocol,
- va_arg (ap, const int *));
+ if (daemon->options & MHD_USE_SSL)
+ _set_priority (&daemon->priority_cache->protocol,
+ va_arg (ap, const int *));
+#if HAVE_MESSAGES
+ else
+ FPRINTF (stderr,
+ "MHD HTTPS option %d passed to MHD but MHD_USE_SSL not
set\n",
+ opt);
+#endif
break;
case MHD_OPTION_HTTPS_MEM_KEY:
- daemon->https_mem_key = va_arg (ap, const char *);
+ if (daemon->options & MHD_USE_SSL)
+ daemon->https_mem_key = va_arg (ap, const char *);
+#if HAVE_MESSAGES
+ else
+ FPRINTF (stderr,
+ "MHD HTTPS option %d passed to MHD but MHD_USE_SSL not
set\n",
+ opt);
+#endif
break;
case MHD_OPTION_HTTPS_MEM_CERT:
- daemon->https_mem_cert = va_arg (ap, const char *);
+ if (daemon->options & MHD_USE_SSL)
+ daemon->https_mem_cert = va_arg (ap, const char *);
+#if HAVE_MESSAGES
+ else
+ FPRINTF (stderr,
+ "MHD HTTPS option %d passed to MHD but MHD_USE_SSL not
set\n",
+ opt);
+#endif
break;
case MHD_OPTION_CIPHER_ALGORITHM:
- _set_priority (&daemon->priority_cache->cipher,
- va_arg (ap, const int *));
+ if (daemon->options & MHD_USE_SSL)
+ _set_priority (&daemon->priority_cache->cipher,
+ va_arg (ap, const int *));
+#if HAVE_MESSAGES
+ else
+ FPRINTF (stderr,
+ "MHD HTTPS option %d passed to MHD but MHD_USE_SSL not
set\n",
+ opt);
+#endif
break;
#endif
case MHD_OPTION_EXTERNAL_LOGGER:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r10384 - libmicrohttpd/src/daemon,
gnunet <=