aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-11-14 14:01:49 +0100
committerChristian Grothoff <christian@grothoff.org>2018-11-14 14:01:49 +0100
commit64e1480540f86081d900592b4940d5edc42ff739 (patch)
treeda8557909cc518a88c011507f54e5bfdaf640110 /src/microhttpd/daemon.c
parentff551c467120239f15080d33f7d529359aea077c (diff)
downloadlibmicrohttpd-64e1480540f86081d900592b4940d5edc42ff739.tar.gz
libmicrohttpd-64e1480540f86081d900592b4940d5edc42ff739.zip
fix build issue with GnuTLS < 3.0
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 2b7bb66d..90c09d29 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2177,6 +2177,7 @@ psk_gnutls_adapter (gnutls_session_t session,
2177 return -1; 2177 return -1;
2178 } 2178 }
2179 daemon = connection->daemon; 2179 daemon = connection->daemon;
2180#if GNUTLS_VERSION_MAJOR >= 3
2180 if (NULL == daemon->cred_callback) 2181 if (NULL == daemon->cred_callback)
2181 { 2182 {
2182#ifdef HAVE_MESSAGES 2183#ifdef HAVE_MESSAGES
@@ -2206,6 +2207,13 @@ psk_gnutls_adapter (gnutls_session_t session,
2206 app_psk_size); 2207 app_psk_size);
2207 free (app_psk); 2208 free (app_psk);
2208 return 0; 2209 return 0;
2210#else
2211#ifdef HAVE_MESSAGES
2212 MHD_DLOG (daemon,
2213 _("PSK not supported by this server.\n"));
2214#endif
2215 return -1;
2216#endif
2209} 2217}
2210#endif /* HTTPS_SUPPORT */ 2218#endif /* HTTPS_SUPPORT */
2211 2219
@@ -3435,7 +3443,7 @@ MHD_run_from_select (struct MHD_Daemon *daemon,
3435#ifdef EPOLL_SUPPORT 3443#ifdef EPOLL_SUPPORT
3436 int ret = MHD_epoll (daemon, 3444 int ret = MHD_epoll (daemon,
3437 MHD_NO); 3445 MHD_NO);
3438 3446
3439 MHD_cleanup_connections (daemon); 3447 MHD_cleanup_connections (daemon);
3440 return ret; 3448 return ret;
3441#else /* ! EPOLL_SUPPORT */ 3449#else /* ! EPOLL_SUPPORT */
@@ -5190,11 +5198,18 @@ parse_options_va (struct MHD_Daemon *daemon,
5190 break; 5198 break;
5191#ifdef HTTPS_SUPPORT 5199#ifdef HTTPS_SUPPORT
5192 case MHD_OPTION_GNUTLS_PSK_CRED_HANDLER: 5200 case MHD_OPTION_GNUTLS_PSK_CRED_HANDLER:
5201#if GNUTLS_VERSION_MAJOR >= 3
5193 daemon->cred_callback = va_arg (ap, 5202 daemon->cred_callback = va_arg (ap,
5194 MHD_PskServerCredentialsCallback); 5203 MHD_PskServerCredentialsCallback);
5195 daemon->cred_callback_cls = va_arg (ap, 5204 daemon->cred_callback_cls = va_arg (ap,
5196 void *); 5205 void *);
5197 break; 5206 break;
5207#else
5208 MHD_DLOG (daemon,
5209 _("MHD HTTPS option %d passed to MHD compiled without GNUtls >= 3\n"),
5210 opt);
5211 return MHD_NO;
5212#endif
5198#endif /* HTTPS_SUPPORT */ 5213#endif /* HTTPS_SUPPORT */
5199 default: 5214 default:
5200#ifdef HAVE_MESSAGES 5215#ifdef HAVE_MESSAGES
@@ -5534,8 +5549,8 @@ MHD_start_daemon_va (unsigned int flags,
5534 5549
5535 if ( (NULL != daemon->notify_completed) && 5550 if ( (NULL != daemon->notify_completed) &&
5536 (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) ) 5551 (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) )
5537 *pflags |= MHD_USE_ITC; /* requires ITC */ 5552 *pflags |= MHD_USE_ITC; /* requires ITC */
5538 5553
5539#ifndef NDEBUG 5554#ifndef NDEBUG
5540#ifdef HAVE_MESSAGES 5555#ifdef HAVE_MESSAGES
5541 MHD_DLOG (daemon, 5556 MHD_DLOG (daemon,