aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-11-02 13:30:20 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-11-02 15:53:51 +0300
commit0f46a6b98b111c0d9b7c1384d68b6d89ce0775fb (patch)
tree399625130575b8275bcba0d2cc2807bd717cf86a
parent82ebcd2dbfb0a836383927c64a7d525e3941924a (diff)
downloadlibmicrohttpd-0f46a6b98b111c0d9b7c1384d68b6d89ce0775fb.tar.gz
libmicrohttpd-0f46a6b98b111c0d9b7c1384d68b6d89ce0775fb.zip
Fixed build without HTTPS support
-rw-r--r--src/microhttpd/connection.c2
-rw-r--r--src/microhttpd/connection.h4
-rw-r--r--src/microhttpd/daemon.c6
-rw-r--r--src/microhttpd/response.c8
4 files changed, 18 insertions, 2 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index e60a5369..01780f9d 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -561,6 +561,7 @@ MHD_connection_close_ (struct MHD_Connection *connection,
561} 561}
562 562
563 563
564#ifdef HTTPS_SUPPORT
564/** 565/**
565 * Stop TLS forwarding on upgraded connection and 566 * Stop TLS forwarding on upgraded connection and
566 * reflect remote disconnect state to socketpair. 567 * reflect remote disconnect state to socketpair.
@@ -616,6 +617,7 @@ MHD_connection_finish_forward_ (struct MHD_Connection *connection)
616 * connection's final cleanup. 617 * connection's final cleanup.
617 */ 618 */
618} 619}
620#endif /* HTTPS_SUPPORT */
619 621
620 622
621/** 623/**
diff --git a/src/microhttpd/connection.h b/src/microhttpd/connection.h
index ecbe2378..ffbc5b80 100644
--- a/src/microhttpd/connection.h
+++ b/src/microhttpd/connection.h
@@ -108,6 +108,7 @@ MHD_connection_close_ (struct MHD_Connection *connection,
108 enum MHD_RequestTerminationCode termination_code); 108 enum MHD_RequestTerminationCode termination_code);
109 109
110 110
111#ifdef HTTPS_SUPPORT
111/** 112/**
112 * Stop TLS forwarding on upgraded connection and 113 * Stop TLS forwarding on upgraded connection and
113 * reflect remote disconnect state to socketpair. 114 * reflect remote disconnect state to socketpair.
@@ -115,6 +116,9 @@ MHD_connection_close_ (struct MHD_Connection *connection,
115 */ 116 */
116void 117void
117MHD_connection_finish_forward_ (struct MHD_Connection *connection); 118MHD_connection_finish_forward_ (struct MHD_Connection *connection);
119#else /* ! HTTPS_SUPPORT */
120#define MHD_connection_finish_forward_(conn) (void)conn
121#endif /* ! HTTPS_SUPPORT */
118 122
119 123
120#ifdef EPOLL_SUPPORT 124#ifdef EPOLL_SUPPORT
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 31aa0bcd..beddac82 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -939,6 +939,7 @@ MHD_cleanup_upgraded_connection_ (struct MHD_Connection *connection)
939{ 939{
940 struct MHD_UpgradeResponseHandle *urh = connection->urh; 940 struct MHD_UpgradeResponseHandle *urh = connection->urh;
941 941
942#ifdef HTTPS_SUPPORT
942 /* Signal remote client the end of TLS connection by 943 /* Signal remote client the end of TLS connection by
943 * gracefully closing TLS session. */ 944 * gracefully closing TLS session. */
944 if (0 != (connection->daemon->options & MHD_USE_TLS)) 945 if (0 != (connection->daemon->options & MHD_USE_TLS))
@@ -950,6 +951,7 @@ MHD_cleanup_upgraded_connection_ (struct MHD_Connection *connection)
950 951
951 if (MHD_INVALID_SOCKET != urh->app.socket) 952 if (MHD_INVALID_SOCKET != urh->app.socket)
952 MHD_socket_close_chk_ (urh->app.socket); 953 MHD_socket_close_chk_ (urh->app.socket);
954#endif /* HTTPS_SUPPORT */
953 955
954 connection->urh = NULL; 956 connection->urh = NULL;
955 if (NULL != urh) 957 if (NULL != urh)
@@ -1230,8 +1232,8 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
1230static void 1232static void
1231thread_main_connection_upgrade (struct MHD_Connection *con) 1233thread_main_connection_upgrade (struct MHD_Connection *con)
1232{ 1234{
1233 struct MHD_UpgradeResponseHandle *urh = con->urh;
1234#ifdef HTTPS_SUPPORT 1235#ifdef HTTPS_SUPPORT
1236 struct MHD_UpgradeResponseHandle *urh = con->urh;
1235 struct MHD_Daemon *daemon = con->daemon; 1237 struct MHD_Daemon *daemon = con->daemon;
1236 1238
1237 /* Here, we need to bi-directionally forward 1239 /* Here, we need to bi-directionally forward
@@ -3803,8 +3805,10 @@ MHD_epoll (struct MHD_Daemon *daemon,
3803 } 3805 }
3804 } 3806 }
3805 3807
3808#ifdef HTTPS_SUPPORT
3806 if (run_upgraded) 3809 if (run_upgraded)
3807 run_epoll_for_upgrade (daemon); 3810 run_epoll_for_upgrade (daemon);
3811#endif /* HTTPS_SUPPORT */
3808 3812
3809 /* we handle resumes here because we may have ready connections 3813 /* we handle resumes here because we may have ready connections
3810 that will not be placed into the epoll list immediately. */ 3814 that will not be placed into the epoll list immediately. */
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index 821aea3f..da2f5384 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -896,7 +896,9 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response,
896 /* Non-TLS connection do not hold any additional resources. */ 896 /* Non-TLS connection do not hold any additional resources. */
897 urh->clean_ready = MHD_YES; 897 urh->clean_ready = MHD_YES;
898 } 898 }
899#endif /* HTTPS_SUPPORT */ 899#else /* ! HTTPS_SUPPORT */
900 urh->clean_ready = MHD_YES;
901#endif /* ! HTTPS_SUPPORT */
900 connection->urh = urh; 902 connection->urh = urh;
901 /* As far as MHD's event loops are concerned, this connection is 903 /* As far as MHD's event loops are concerned, this connection is
902 suspended; it will be resumed once application is done by the 904 suspended; it will be resumed once application is done by the
@@ -909,8 +911,12 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response,
909 connection->client_context, 911 connection->client_context,
910 connection->read_buffer, 912 connection->read_buffer,
911 rbo, 913 rbo,
914#ifdef HTTPS_SUPPORT
912 (0 == (daemon->options & MHD_USE_TLS) ) ? 915 (0 == (daemon->options & MHD_USE_TLS) ) ?
913 connection->socket_fd : urh->app.socket, 916 connection->socket_fd : urh->app.socket,
917#else /* ! HTTPS_SUPPORT */
918 connection->socket_fd,
919#endif /* ! HTTPS_SUPPORT */
914 urh); 920 urh);
915 return MHD_YES; 921 return MHD_YES;
916} 922}