summaryrefslogtreecommitdiff
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)
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,
}
+#ifdef HTTPS_SUPPORT
/**
* Stop TLS forwarding on upgraded connection and
* reflect remote disconnect state to socketpair.
@@ -616,6 +617,7 @@ MHD_connection_finish_forward_ (struct MHD_Connection *connection)
* connection's final cleanup.
*/
}
+#endif /* HTTPS_SUPPORT */
/**
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,
enum MHD_RequestTerminationCode termination_code);
+#ifdef HTTPS_SUPPORT
/**
* Stop TLS forwarding on upgraded connection and
* reflect remote disconnect state to socketpair.
@@ -115,6 +116,9 @@ MHD_connection_close_ (struct MHD_Connection *connection,
*/
void
MHD_connection_finish_forward_ (struct MHD_Connection *connection);
+#else /* ! HTTPS_SUPPORT */
+#define MHD_connection_finish_forward_(conn) (void)conn
+#endif /* ! HTTPS_SUPPORT */
#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)
{
struct MHD_UpgradeResponseHandle *urh = connection->urh;
+#ifdef HTTPS_SUPPORT
/* Signal remote client the end of TLS connection by
* gracefully closing TLS session. */
if (0 != (connection->daemon->options & MHD_USE_TLS))
@@ -950,6 +951,7 @@ MHD_cleanup_upgraded_connection_ (struct MHD_Connection *connection)
if (MHD_INVALID_SOCKET != urh->app.socket)
MHD_socket_close_chk_ (urh->app.socket);
+#endif /* HTTPS_SUPPORT */
connection->urh = NULL;
if (NULL != urh)
@@ -1230,8 +1232,8 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
static void
thread_main_connection_upgrade (struct MHD_Connection *con)
{
- struct MHD_UpgradeResponseHandle *urh = con->urh;
#ifdef HTTPS_SUPPORT
+ struct MHD_UpgradeResponseHandle *urh = con->urh;
struct MHD_Daemon *daemon = con->daemon;
/* Here, we need to bi-directionally forward
@@ -3803,8 +3805,10 @@ MHD_epoll (struct MHD_Daemon *daemon,
}
}
+#ifdef HTTPS_SUPPORT
if (run_upgraded)
run_epoll_for_upgrade (daemon);
+#endif /* HTTPS_SUPPORT */
/* we handle resumes here because we may have ready connections
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,
/* Non-TLS connection do not hold any additional resources. */
urh->clean_ready = MHD_YES;
}
-#endif /* HTTPS_SUPPORT */
+#else /* ! HTTPS_SUPPORT */
+ urh->clean_ready = MHD_YES;
+#endif /* ! HTTPS_SUPPORT */
connection->urh = urh;
/* As far as MHD's event loops are concerned, this connection is
suspended; it will be resumed once application is done by the
@@ -909,8 +911,12 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response,
connection->client_context,
connection->read_buffer,
rbo,
+#ifdef HTTPS_SUPPORT
(0 == (daemon->options & MHD_USE_TLS) ) ?
connection->socket_fd : urh->app.socket,
+#else /* ! HTTPS_SUPPORT */
+ connection->socket_fd,
+#endif /* ! HTTPS_SUPPORT */
urh);
return MHD_YES;
}