aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--src/microhttpd/daemon.c18
2 files changed, 11 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index b812805b..946d0aab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -347,6 +347,8 @@ AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
347 #endif 347 #endif
348 ]) 348 ])
349 349
350AC_CHECK_FUNCS([poll])
351
350# Check for pipe/socketpair signaling 352# Check for pipe/socketpair signaling
351AC_MSG_CHECKING([[whether to enable signaling by socketpair]]) 353AC_MSG_CHECKING([[whether to enable signaling by socketpair]])
352 354
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 97f792eb..26791d05 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -50,7 +50,7 @@
50#include <gcrypt.h> 50#include <gcrypt.h>
51#endif 51#endif
52 52
53#ifdef HAVE_POLL_H 53#if defined(HAVE_POLL_H) && defined(HAVE_POLL)
54#include <poll.h> 54#include <poll.h>
55#endif 55#endif
56 56
@@ -795,14 +795,14 @@ MHD_handle_connection (void *data)
795#if WINDOWS 795#if WINDOWS
796 MHD_pipe spipe = con->daemon->wpipe[0]; 796 MHD_pipe spipe = con->daemon->wpipe[0];
797 char tmp; 797 char tmp;
798#ifdef HAVE_POLL_H 798#ifdef HAVE_POLL
799 int extra_slot; 799 int extra_slot;
800#endif /* HAVE_POLL_H */ 800#endif /* HAVE_POLL */
801#define EXTRA_SLOTS 1 801#define EXTRA_SLOTS 1
802#else /* !WINDOWS */ 802#else /* !WINDOWS */
803#define EXTRA_SLOTS 0 803#define EXTRA_SLOTS 0
804#endif /* !WINDOWS */ 804#endif /* !WINDOWS */
805#ifdef HAVE_POLL_H 805#ifdef HAVE_POLL
806 struct pollfd p[1 + EXTRA_SLOTS]; 806 struct pollfd p[1 + EXTRA_SLOTS];
807#endif 807#endif
808 808
@@ -914,7 +914,7 @@ MHD_handle_connection (void *data)
914 if (MHD_NO == con->idle_handler (con)) 914 if (MHD_NO == con->idle_handler (con))
915 goto exit; 915 goto exit;
916 } 916 }
917#ifdef HAVE_POLL_H 917#ifdef HAVE_POLL
918 else 918 else
919 { 919 {
920 /* use poll */ 920 /* use poll */
@@ -2341,7 +2341,7 @@ MHD_select (struct MHD_Daemon *daemon,
2341} 2341}
2342 2342
2343 2343
2344#ifdef HAVE_POLL_H 2344#ifdef HAVE_POLL
2345/** 2345/**
2346 * Process all of our connections and possibly the server 2346 * Process all of our connections and possibly the server
2347 * socket using poll(). 2347 * socket using poll().
@@ -2598,7 +2598,7 @@ static int
2598MHD_poll (struct MHD_Daemon *daemon, 2598MHD_poll (struct MHD_Daemon *daemon,
2599 int may_block) 2599 int may_block)
2600{ 2600{
2601#ifdef HAVE_POLL_H 2601#ifdef HAVE_POLL
2602 if (MHD_YES == daemon->shutdown) 2602 if (MHD_YES == daemon->shutdown)
2603 return MHD_NO; 2603 return MHD_NO;
2604 if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) 2604 if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
@@ -3579,7 +3579,7 @@ MHD_start_daemon_va (unsigned int flags,
3579 if (0 != (flags & MHD_USE_IPv6)) 3579 if (0 != (flags & MHD_USE_IPv6))
3580 return NULL; 3580 return NULL;
3581#endif 3581#endif
3582#ifndef HAVE_POLL_H 3582#ifndef HAVE_POLL
3583 if (0 != (flags & MHD_USE_POLL)) 3583 if (0 != (flags & MHD_USE_POLL))
3584 return NULL; 3584 return NULL;
3585#endif 3585#endif
@@ -4697,7 +4697,7 @@ MHD_is_feature_supported(enum MHD_FEATURE feature)
4697 return MHD_NO; 4697 return MHD_NO;
4698#endif 4698#endif
4699 case MHD_FEATURE_POLL: 4699 case MHD_FEATURE_POLL:
4700#ifdef HAVE_POLL_H 4700#ifdef HAVE_POLL
4701 return MHD_YES; 4701 return MHD_YES;
4702#else 4702#else
4703 return MHD_NO; 4703 return MHD_NO;