aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-02-27 21:06:15 +0100
committerChristian Grothoff <christian@grothoff.org>2018-02-27 21:06:15 +0100
commit11f599e039f8581eb6402a469e1dfdf0ec088ccd (patch)
tree420b09dbadcfd4cf529e3d8f5c3136dfaeeb6010
parent03e8efaeeb6234ca9f7edea108719191e4effb30 (diff)
downloadlibmicrohttpd-11f599e039f8581eb6402a469e1dfdf0ec088ccd.tar.gz
libmicrohttpd-11f599e039f8581eb6402a469e1dfdf0ec088ccd.zip
fix ftbfs if https is not enabled in src/lib/
-rw-r--r--src/lib/daemon_options.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/lib/daemon_options.c b/src/lib/daemon_options.c
index 991b9898..94c8fa0b 100644
--- a/src/lib/daemon_options.c
+++ b/src/lib/daemon_options.c
@@ -408,14 +408,18 @@ MHD_daemon_tls_key_and_cert_from_memory (struct MHD_Daemon *daemon,
408 const char *mem_cert, 408 const char *mem_cert,
409 const char *pass) 409 const char *pass)
410{ 410{
411#ifndef HTTPS_SUPPORT
412 return MHD_SC_TLS_DISABLED;
413#else
411 struct MHD_TLS_Plugin *plugin; 414 struct MHD_TLS_Plugin *plugin;
412 415
413 if (NULL == (plugin = daemon->tls_api)) 416 if (NULL == (plugin = daemon->tls_api))
414 return MHD_SC_TLS_BACKEND_UNINITIALIZED; 417 return MHD_SC_TLS_BACKEND_UNINITIALIZED;
415 return plugin->init_kcp (plugin->cls, 418 return plugin->init_kcp (plugin->cls,
416 mem_key, 419 mem_key,
417 mem_cert, 420 mem_cert,
418 pass); 421 pass);
422#endif
419} 423}
420 424
421 425
@@ -432,12 +436,16 @@ enum MHD_StatusCode
432MHD_daemon_tls_mem_dhparams (struct MHD_Daemon *daemon, 436MHD_daemon_tls_mem_dhparams (struct MHD_Daemon *daemon,
433 const char *dh) 437 const char *dh)
434{ 438{
439#ifndef HTTPS_SUPPORT
440 return MHD_SC_TLS_DISABLED;
441#else
435 struct MHD_TLS_Plugin *plugin; 442 struct MHD_TLS_Plugin *plugin;
436 443
437 if (NULL == (plugin = daemon->tls_api)) 444 if (NULL == (plugin = daemon->tls_api))
438 return MHD_SC_TLS_BACKEND_UNINITIALIZED; 445 return MHD_SC_TLS_BACKEND_UNINITIALIZED;
439 return plugin->init_dhparams (plugin->cls, 446 return plugin->init_dhparams (plugin->cls,
440 dh); 447 dh);
448#endif
441} 449}
442 450
443 451
@@ -454,12 +462,16 @@ enum MHD_StatusCode
454MHD_daemon_tls_mem_trust (struct MHD_Daemon *daemon, 462MHD_daemon_tls_mem_trust (struct MHD_Daemon *daemon,
455 const char *mem_trust) 463 const char *mem_trust)
456{ 464{
465#ifndef HTTPS_SUPPORT
466 return MHD_SC_TLS_DISABLED;
467#else
457 struct MHD_TLS_Plugin *plugin; 468 struct MHD_TLS_Plugin *plugin;
458 469
459 if (NULL == (plugin = daemon->tls_api)) 470 if (NULL == (plugin = daemon->tls_api))
460 return MHD_SC_TLS_BACKEND_UNINITIALIZED; 471 return MHD_SC_TLS_BACKEND_UNINITIALIZED;
461 return plugin->init_mem_trust (plugin->cls, 472 return plugin->init_mem_trust (plugin->cls,
462 mem_trust); 473 mem_trust);
474#endif
463} 475}
464 476
465 477
@@ -474,11 +486,15 @@ enum MHD_StatusCode
474MHD_daemon_gnutls_credentials (struct MHD_Daemon *daemon, 486MHD_daemon_gnutls_credentials (struct MHD_Daemon *daemon,
475 int gnutls_credentials) 487 int gnutls_credentials)
476{ 488{
489#ifndef HTTPS_SUPPORT
490 return MHD_SC_TLS_DISABLED;
491#else
477 struct MHD_TLS_Plugin *plugin; 492 struct MHD_TLS_Plugin *plugin;
478 493
479 if (NULL == (plugin = daemon->tls_api)) 494 if (NULL == (plugin = daemon->tls_api))
480 return MHD_SC_TLS_BACKEND_UNINITIALIZED; 495 return MHD_SC_TLS_BACKEND_UNINITIALIZED;
481 return MHD_SC_TLS_BACKEND_OPERATION_UNSUPPORTED; 496 return MHD_SC_TLS_BACKEND_OPERATION_UNSUPPORTED;
497#endif
482} 498}
483 499
484 500
@@ -503,11 +519,15 @@ enum MHD_StatusCode
503MHD_daemon_gnutls_key_and_cert_from_callback (struct MHD_Daemon *daemon, 519MHD_daemon_gnutls_key_and_cert_from_callback (struct MHD_Daemon *daemon,
504 void *cb) 520 void *cb)
505{ 521{
522#ifndef HTTPS_SUPPORT
523 return MHD_SC_TLS_DISABLED;
524#else
506 struct MHD_TLS_Plugin *plugin; 525 struct MHD_TLS_Plugin *plugin;
507 526
508 if (NULL == (plugin = daemon->tls_api)) 527 if (NULL == (plugin = daemon->tls_api))
509 return MHD_SC_TLS_BACKEND_UNINITIALIZED; 528 return MHD_SC_TLS_BACKEND_UNINITIALIZED;
510 return MHD_SC_TLS_BACKEND_OPERATION_UNSUPPORTED; 529 return MHD_SC_TLS_BACKEND_OPERATION_UNSUPPORTED;
530#endif
511} 531}
512 532
513 533
@@ -547,7 +567,7 @@ MHD_daemon_accept_policy (struct MHD_Daemon *daemon,
547 567
548/** 568/**
549 * Register a callback to be called first for every request 569 * Register a callback to be called first for every request
550 * (before any parsing of the header). Makes it easy to 570 * (before any parsing of the header). Makes it easy to
551 * log the full URL. 571 * log the full URL.
552 * 572 *
553 * @param daemon daemon for which to set the logger 573 * @param daemon daemon for which to set the logger