commit 8b531fd28c1dbaa0671f251ff09bc7d377fc1bca
parent 77398cdb5522ecccf7a7a7163ad9f23b467889c1
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 5 Mar 2018 18:49:56 +0100
fix misc build issues if various features (poll/epoll/upgrade-support) are disabled
Diffstat:
7 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/doc/Makefile.am b/doc/Makefile.am
@@ -55,3 +55,6 @@ uninstall-local:
echo " rm -f '$(DESTDIR)$(infodir)/libmicrohttpd_performance_data.png'"; \
rm -f "$(DESTDIR)$(infodir)/libmicrohttpd_performance_data.png" \
else : ; fi
+
+# end of 'if BUILD_DOC'
+
diff --git a/src/lib/daemon_poll.c b/src/lib/daemon_poll.c
@@ -315,7 +315,7 @@ MHD_daemon_poll_all_ (struct MHD_Daemon *daemon,
(p[poll_server+i+1].fd != urh->mhd.socket))
break;
urh_from_pollfd (urh,
- &(p[poll_server+i]));
+ &p[poll_server+i]);
i += 2;
MHD_upgrade_response_handle_process_ (urh);
/* Finished forwarding? */
@@ -457,6 +457,7 @@ MHD_daemon_poll_ (struct MHD_Daemon *daemon,
}
+#ifdef HAVE_POLL
#ifdef HTTPS_SUPPORT
/**
* Process upgraded connection with a poll() loop.
@@ -514,5 +515,6 @@ MHD_daemon_upgrade_connection_with_poll_ (struct MHD_Connection *con)
}
}
#endif
+#endif
/* end of daemon_poll.c */
diff --git a/src/lib/daemon_poll.h b/src/lib/daemon_poll.h
@@ -69,6 +69,7 @@ MHD_daemon_poll_ (struct MHD_Daemon *daemon,
#ifdef HTTPS_SUPPORT
+#ifdef HAVE_POLL
/**
* Process upgraded connection with a poll() loop.
* We are in our own thread, only processing @a con
@@ -79,5 +80,6 @@ void
MHD_daemon_upgrade_connection_with_poll_ (struct MHD_Connection *con)
MHD_NONNULL(1);
#endif
+#endif
#endif
diff --git a/src/lib/daemon_select.c b/src/lib/daemon_select.c
@@ -350,7 +350,7 @@ MHD_daemon_get_fdset2 (struct MHD_Daemon *daemon,
}
-#ifdef HTTPS_SUPPORT
+#if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
/**
* Update the @a urh based on the ready FDs in
* the @a rs, @a ws, and @a es.
@@ -487,7 +487,7 @@ internal_run_from_select (struct MHD_Daemon *daemon,
}
-#ifdef HTTPS_SUPPORT
+#if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
/**
* Process upgraded connection with a select loop.
* We are in our own thread, only processing @a con
diff --git a/src/lib/daemon_select.h b/src/lib/daemon_select.h
@@ -40,7 +40,7 @@ MHD_daemon_select_ (struct MHD_Daemon *daemon,
MHD_NONNULL(1);
-#ifdef HTTPS_SUPPORT
+#if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
/**
* Process upgraded connection with a select loop.
* We are in our own thread, only processing @a con
diff --git a/src/lib/internal.h b/src/lib/internal.h
@@ -578,7 +578,6 @@ struct MHD_Request
};
-#ifdef EPOLL_SUPPORT
/**
* State of the socket with respect to epoll (bitmask).
*/
@@ -623,7 +622,6 @@ enum MHD_EpollState
*/
MHD_EPOLL_STATE_ERROR = 128
};
-#endif
/**
@@ -836,12 +834,10 @@ struct UpgradeEpollHandle
*/
MHD_socket socket;
-#ifdef EPOLL_SUPPORT
/**
* IO-state of the @e socket (or the connection's `socket_fd`).
*/
enum MHD_EpollState celi;
-#endif
};
diff --git a/src/lib/response_for_upgrade.c b/src/lib/response_for_upgrade.c
@@ -59,6 +59,7 @@ struct MHD_Response *
MHD_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
void *upgrade_handler_cls)
{
+#ifdef UPGRADE_SUPPORT
struct MHD_Response *response;
mhd_assert (NULL != upgrade_handler);
@@ -85,6 +86,9 @@ MHD_response_for_upgrade (MHD_UpgradeHandler upgrade_handler,
return NULL;
}
return response;
+#else
+ return NULL;
+#endif
}
/* end of response_for_upgrade.c */