Преглед изворни кода

fix misc build issues if various features (poll/epoll/upgrade-support) are disabled

Christian Grothoff пре 8 година
родитељ
комит
8b531fd28c

+ 3 - 0
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'
+

+ 3 - 1
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 */

+ 2 - 0
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

+ 2 - 2
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

+ 1 - 1
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

+ 0 - 4
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
 
 };
 

+ 4 - 0
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 */