diff --git a/src/lib/daemon_options.c b/src/lib/daemon_options.c index 991b989..e89fbc6 100644 --- a/src/lib/daemon_options.c +++ b/src/lib/daemon_options.c @@ -408,6 +408,9 @@ MHD_daemon_tls_key_and_cert_from_memory (struct MHD_Daemon *daemon, const char *mem_cert, const char *pass) { +#ifndef HTTPS_SUPPORT + return MHD_SC_TLS_DISABLED; +#else struct MHD_TLS_Plugin *plugin; if (NULL == (plugin = daemon->tls_api)) @@ -416,6 +419,7 @@ MHD_daemon_tls_key_and_cert_from_memory (struct MHD_Daemon *daemon, mem_key, mem_cert, pass); +#endif } @@ -432,12 +436,16 @@ enum MHD_StatusCode MHD_daemon_tls_mem_dhparams (struct MHD_Daemon *daemon, const char *dh) { +#ifndef HTTPS_SUPPORT + return MHD_SC_TLS_DISABLED; +#else struct MHD_TLS_Plugin *plugin; if (NULL == (plugin = daemon->tls_api)) return MHD_SC_TLS_BACKEND_UNINITIALIZED; return plugin->init_dhparams (plugin->cls, dh); +#endif } @@ -454,12 +462,16 @@ enum MHD_StatusCode MHD_daemon_tls_mem_trust (struct MHD_Daemon *daemon, const char *mem_trust) { +#ifndef HTTPS_SUPPORT + return MHD_SC_TLS_DISABLED; +#else struct MHD_TLS_Plugin *plugin; if (NULL == (plugin = daemon->tls_api)) return MHD_SC_TLS_BACKEND_UNINITIALIZED; return plugin->init_mem_trust (plugin->cls, mem_trust); +#endif } @@ -474,11 +486,15 @@ enum MHD_StatusCode MHD_daemon_gnutls_credentials (struct MHD_Daemon *daemon, int gnutls_credentials) { +#ifndef HTTPS_SUPPORT + return MHD_SC_TLS_DISABLED; +#else struct MHD_TLS_Plugin *plugin; if (NULL == (plugin = daemon->tls_api)) return MHD_SC_TLS_BACKEND_UNINITIALIZED; return MHD_SC_TLS_BACKEND_OPERATION_UNSUPPORTED; +#endif } @@ -503,11 +519,15 @@ enum MHD_StatusCode MHD_daemon_gnutls_key_and_cert_from_callback (struct MHD_Daemon *daemon, void *cb) { +#ifndef HTTPS_SUPPORT + return MHD_SC_TLS_DISABLED; +#else struct MHD_TLS_Plugin *plugin; if (NULL == (plugin = daemon->tls_api)) return MHD_SC_TLS_BACKEND_UNINITIALIZED; return MHD_SC_TLS_BACKEND_OPERATION_UNSUPPORTED; +#endif } diff --git a/src/lib/daemon_select.c b/src/lib/daemon_select.c index d2740b7..66ed5a8 100644 --- a/src/lib/daemon_select.c +++ b/src/lib/daemon_select.c @@ -350,6 +350,7 @@ MHD_daemon_get_fdset2 (struct MHD_Daemon *daemon, } +#ifdef HTTPS_SUPPORT /** * Update the @a urh based on the ready FDs in * the @a rs, @a ws, and @a es. @@ -391,6 +392,7 @@ urh_from_fdset (struct MHD_UpgradeResponseHandle *urh, urh->mhd.celi |= MHD_EPOLL_STATE_ERROR; } } +#endif /**