[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 02/06: Merged MHD_tls_connection_handle_wri
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 02/06: Merged MHD_tls_connection_handle_write() into MHD_connection_handle_write() |
Date: |
Mon, 05 Jun 2017 22:49:05 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 237330045b9085a75aeaee94d8d274ec9cecb9fd
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Mon Jun 5 23:00:52 2017 +0300
Merged MHD_tls_connection_handle_write() into MHD_connection_handle_write()
---
src/microhttpd/connection.c | 12 +++++++++++-
src/microhttpd/connection_https.c | 21 ---------------------
src/microhttpd/daemon.c | 6 +++---
src/microhttpd/internal.h | 6 ------
4 files changed, 14 insertions(+), 31 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index c0fb687b..1833b060 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2783,6 +2783,17 @@ MHD_connection_handle_write (struct MHD_Connection
*connection)
if (connection->suspended)
return MHD_YES;
+#ifdef HTTPS_SUPPORT
+ if (MHD_TLS_CONN_NO_TLS != connection->tls_state)
+ { /* HTTPS connection. */
+ if (MHD_TLS_CONN_CONNECTED > connection->tls_state)
+ {
+ if (!MHD_run_tls_handshake_ (connection))
+ return MHD_YES;
+ }
+ }
+#endif /* HTTPS_SUPPORT */
+
while (1)
{
#if DEBUG_STATES
@@ -3635,7 +3646,6 @@ MHD_connection_epoll_update_ (struct MHD_Connection
*connection)
void
MHD_set_http_callbacks_ (struct MHD_Connection *connection)
{
- connection->write_handler = &MHD_connection_handle_write;
connection->recv_cls = &recv_param_adapter;
connection->send_cls = &send_param_adapter;
}
diff --git a/src/microhttpd/connection_https.c
b/src/microhttpd/connection_https.c
index c168d543..19d6db59 100644
--- a/src/microhttpd/connection_https.c
+++ b/src/microhttpd/connection_https.c
@@ -181,26 +181,6 @@ MHD_run_tls_handshake_ (struct MHD_Connection *connection)
/**
- * This function was created to handle writes to sockets when it has
- * been determined that the socket can be written to. This function
- * will forward all write requests to the underlying daemon unless
- * the connection has been marked for closing.
- *
- * @return always #MHD_YES (we should continue to process the connection)
- */
-static int
-MHD_tls_connection_handle_write (struct MHD_Connection *connection)
-{
- if (MHD_TLS_CONN_CONNECTED > connection->tls_state)
- {
- if (!MHD_run_tls_handshake_(connection))
- return MHD_YES;
- }
- return MHD_connection_handle_write (connection);
-}
-
-
-/**
* Set connection callback function to be used through out
* the processing of this secure connection.
*
@@ -209,7 +189,6 @@ MHD_tls_connection_handle_write (struct MHD_Connection
*connection)
void
MHD_set_https_callbacks (struct MHD_Connection *connection)
{
- connection->write_handler = &MHD_tls_connection_handle_write;
connection->recv_cls = &recv_tls_adapter;
connection->send_cls = &send_tls_adapter;
}
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index d54cdbf5..cb7064a4 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1052,7 +1052,7 @@ call_handlers (struct MHD_Connection *con,
if ( (MHD_EVENT_LOOP_INFO_WRITE == con->event_loop_info) &&
write_ready)
{
- con->write_handler (con);
+ MHD_connection_handle_write (con);
ret = MHD_connection_handle_idle (con);
states_info_processed = true;
}
@@ -1083,7 +1083,7 @@ call_handlers (struct MHD_Connection *con,
{
if (MHD_CONNECTION_HEADERS_SENDING == con->state)
{
- con->write_handler (con);
+ MHD_connection_handle_write (con);
/* Always call 'MHD_connection_handle_idle()' after each read/write.
*/
ret = MHD_connection_handle_idle (con);
}
@@ -1093,7 +1093,7 @@ call_handlers (struct MHD_Connection *con,
if ((MHD_CONNECTION_NORMAL_BODY_READY == con->state) ||
(MHD_CONNECTION_CHUNKED_BODY_READY == con->state))
{
- con->write_handler (con);
+ MHD_connection_handle_write (con);
ret = MHD_connection_handle_idle (con);
}
}
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 90c7259f..7a47651e 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -931,12 +931,6 @@ struct MHD_Connection
uint64_t current_chunk_offset;
/**
- * Handler used for processing write connection operations
- * @sa #MHD_connection_handle_write, #MHD_tls_connection_handle_write
- */
- int (*write_handler) (struct MHD_Connection *connection);
-
- /**
* Function used for reading HTTP request stream.
*/
ReceiveCallback recv_cls;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [libmicrohttpd] branch master updated (1d356a1f -> 5c988da5), gnunet, 2017/06/05
- [GNUnet-SVN] [libmicrohttpd] 03/06: MHD_connection_handle_read(): changed return type to void as return value is not used Functionality is unchanged., gnunet, 2017/06/05
- [GNUnet-SVN] [libmicrohttpd] 05/06: MHD_connection_handle_read(): simplified and unified code, removed dead code. Functionality is unchanged., gnunet, 2017/06/05
- [GNUnet-SVN] [libmicrohttpd] 04/06: MHD_connection_handle_write(): changed return type to void as return value is not used Functionality is unchanged., gnunet, 2017/06/05
- [GNUnet-SVN] [libmicrohttpd] 02/06: Merged MHD_tls_connection_handle_write() into MHD_connection_handle_write(),
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 01/06: Merged MHD_tls_connection_handle_read() into MHD_connection_handle_read(), gnunet, 2017/06/05
- [GNUnet-SVN] [libmicrohttpd] 06/06: MHD_connection_handle_write(): simplified and unified code, removed dead code. Functionality is unchanged., gnunet, 2017/06/05