Merged MHD_tls_connection_handle_write() into MHD_connection_handle_write()

This commit is contained in:
Evgeny Grin (Karlson2k)
2017-06-05 23:01:57 +03:00
parent de669ead80
commit 237330045b
4 changed files with 14 additions and 31 deletions
+11 -1
View File
@@ -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;
}
-21
View File
@@ -180,26 +180,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;
}
+3 -3
View File
@@ -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);
}
}
-6
View File
@@ -930,12 +930,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.
*/