libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit dd7f9dfe91f01cd56db0d64fe01b05eecae6ee3a
parent 9fef2196c6dbd8c54f4291bf80a4ced03de7660b
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Fri, 21 Oct 2022 09:30:09 +0300

Renamed one more connection state for clarity

Diffstat:
Msrc/microhttpd/connection.c | 14+++++++-------
Msrc/microhttpd/internal.c | 6++++--
Msrc/microhttpd/internal.h | 4++--
3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -2554,7 +2554,7 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection) case MHD_CONNECTION_CONTINUE_SENDING: connection->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE; break; - case MHD_CONNECTION_CONTINUE_SENT: + case MHD_CONNECTION_BODY_RECEIVING: if (connection->read_buffer_offset == connection->read_buffer_size) { const bool internal_poll = (0 != (connection->daemon->options @@ -4173,7 +4173,7 @@ MHD_connection_handle_read (struct MHD_Connection *connection, case MHD_CONNECTION_HEADERS_RECEIVED: case MHD_CONNECTION_HEADERS_PROCESSED: case MHD_CONNECTION_CONTINUE_SENDING: - case MHD_CONNECTION_CONTINUE_SENT: + case MHD_CONNECTION_BODY_RECEIVING: case MHD_CONNECTION_BODY_RECEIVED: case MHD_CONNECTION_FOOTER_PART_RECEIVED: case MHD_CONNECTION_FOOTERS_RECEIVED: @@ -4297,7 +4297,7 @@ MHD_connection_handle_write (struct MHD_Connection *connection) connection->continue_message_write_offset += (size_t) ret; MHD_update_last_activity_ (connection); return; - case MHD_CONNECTION_CONTINUE_SENT: + case MHD_CONNECTION_BODY_RECEIVING: case MHD_CONNECTION_BODY_RECEIVED: case MHD_CONNECTION_FOOTER_PART_RECEIVED: case MHD_CONNECTION_FOOTERS_RECEIVED: @@ -4941,7 +4941,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) } connection->state = (0 == connection->rq.remaining_upload_size) ? MHD_CONNECTION_FULL_REQ_RECEIVED - : MHD_CONNECTION_CONTINUE_SENT; + : MHD_CONNECTION_BODY_RECEIVING; if (connection->suspended) break; continue; @@ -4949,17 +4949,17 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) if (connection->continue_message_write_offset == MHD_STATICSTR_LEN_ (HTTP_100_CONTINUE)) { - connection->state = MHD_CONNECTION_CONTINUE_SENT; + connection->state = MHD_CONNECTION_BODY_RECEIVING; continue; } break; - case MHD_CONNECTION_CONTINUE_SENT: + case MHD_CONNECTION_BODY_RECEIVING: if (0 != connection->read_buffer_offset) { process_request_body (connection); /* loop call */ if (connection->discard_request) { - mhd_assert (MHD_CONNECTION_CONTINUE_SENT != connection->state); + mhd_assert (MHD_CONNECTION_BODY_RECEIVING != connection->state); continue; } } diff --git a/src/microhttpd/internal.c b/src/microhttpd/internal.c @@ -1,6 +1,7 @@ /* This file is part of libmicrohttpd Copyright (C) 2007 Daniel Pittman and Christian Grothoff + Copyright (C) 2015-2021 Evgeny Grin (Karlson2k) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -22,6 +23,7 @@ * @brief internal shared structures * @author Daniel Pittman * @author Christian Grothoff + * @author Karlson2k (Evgeny Grin) */ #include "internal.h" @@ -51,8 +53,8 @@ MHD_state_to_string (enum MHD_CONNECTION_STATE state) return "headers processed"; case MHD_CONNECTION_CONTINUE_SENDING: return "continue sending"; - case MHD_CONNECTION_CONTINUE_SENT: - return "continue sent"; + case MHD_CONNECTION_BODY_RECEIVING: + return "body receiving"; case MHD_CONNECTION_BODY_RECEIVED: return "body received"; case MHD_CONNECTION_FOOTER_PART_RECEIVED: diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h @@ -649,12 +649,12 @@ enum MHD_CONNECTION_STATE /** * We have sent 100 CONTINUE (or do not need to). Read the message body. */ - MHD_CONNECTION_CONTINUE_SENT = MHD_CONNECTION_CONTINUE_SENDING + 1, + MHD_CONNECTION_BODY_RECEIVING = MHD_CONNECTION_CONTINUE_SENDING + 1, /** * We got the request body. Wait for a line of the footer. */ - MHD_CONNECTION_BODY_RECEIVED = MHD_CONNECTION_CONTINUE_SENT + 1, + MHD_CONNECTION_BODY_RECEIVED = MHD_CONNECTION_BODY_RECEIVING + 1, /** * We got part of a line of the footer. Wait for the