libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 64e1480540f86081d900592b4940d5edc42ff739
parent ff551c467120239f15080d33f7d529359aea077c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 14 Nov 2018 14:01:49 +0100

fix build issue with GnuTLS < 3.0

Diffstat:
MChangeLog | 3+++
Msrc/microhttpd/daemon.c | 21++++++++++++++++++---
Msrc/microhttpd/internal.h | 2+-
3 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,6 @@ +Wed Nov 14 14:01:21 CET 2018 + Fix build issue with GnuTLS < 3.0. -CG + Mon Nov 12 19:50:43 CET 2018 Fix #5473 (test case failure due to change in libcurl). -eworm diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -2177,6 +2177,7 @@ psk_gnutls_adapter (gnutls_session_t session, return -1; } daemon = connection->daemon; +#if GNUTLS_VERSION_MAJOR >= 3 if (NULL == daemon->cred_callback) { #ifdef HAVE_MESSAGES @@ -2206,6 +2207,13 @@ psk_gnutls_adapter (gnutls_session_t session, app_psk_size); free (app_psk); return 0; +#else +#ifdef HAVE_MESSAGES + MHD_DLOG (daemon, + _("PSK not supported by this server.\n")); +#endif + return -1; +#endif } #endif /* HTTPS_SUPPORT */ @@ -3435,7 +3443,7 @@ MHD_run_from_select (struct MHD_Daemon *daemon, #ifdef EPOLL_SUPPORT int ret = MHD_epoll (daemon, MHD_NO); - + MHD_cleanup_connections (daemon); return ret; #else /* ! EPOLL_SUPPORT */ @@ -5190,11 +5198,18 @@ parse_options_va (struct MHD_Daemon *daemon, break; #ifdef HTTPS_SUPPORT case MHD_OPTION_GNUTLS_PSK_CRED_HANDLER: +#if GNUTLS_VERSION_MAJOR >= 3 daemon->cred_callback = va_arg (ap, MHD_PskServerCredentialsCallback); daemon->cred_callback_cls = va_arg (ap, void *); break; +#else + MHD_DLOG (daemon, + _("MHD HTTPS option %d passed to MHD compiled without GNUtls >= 3\n"), + opt); + return MHD_NO; +#endif #endif /* HTTPS_SUPPORT */ default: #ifdef HAVE_MESSAGES @@ -5534,8 +5549,8 @@ MHD_start_daemon_va (unsigned int flags, if ( (NULL != daemon->notify_completed) && (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) ) - *pflags |= MHD_USE_ITC; /* requires ITC */ - + *pflags |= MHD_USE_ITC; /* requires ITC */ + #ifndef NDEBUG #ifdef HAVE_MESSAGES MHD_DLOG (daemon, diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h @@ -1,6 +1,6 @@ /* This file is part of libmicrohttpd - Copyright (C) 2007-2017 Daniel Pittman and Christian Grothoff + Copyright (C) 2007-2018 Daniel Pittman and Christian Grothoff This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public