aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-10-21 09:30:09 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-10-22 09:48:06 +0300
commitdd7f9dfe91f01cd56db0d64fe01b05eecae6ee3a (patch)
tree93abd81ff53ca6262aa8d7407a82ef89bdedf42d
parent9fef2196c6dbd8c54f4291bf80a4ced03de7660b (diff)
downloadlibmicrohttpd-dd7f9dfe91f01cd56db0d64fe01b05eecae6ee3a.tar.gz
libmicrohttpd-dd7f9dfe91f01cd56db0d64fe01b05eecae6ee3a.zip
Renamed one more connection state for clarity
-rw-r--r--src/microhttpd/connection.c14
-rw-r--r--src/microhttpd/internal.c6
-rw-r--r--src/microhttpd/internal.h4
3 files changed, 13 insertions, 11 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index da2cd248..9589a2d8 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2554,7 +2554,7 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection)
2554 case MHD_CONNECTION_CONTINUE_SENDING: 2554 case MHD_CONNECTION_CONTINUE_SENDING:
2555 connection->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE; 2555 connection->event_loop_info = MHD_EVENT_LOOP_INFO_WRITE;
2556 break; 2556 break;
2557 case MHD_CONNECTION_CONTINUE_SENT: 2557 case MHD_CONNECTION_BODY_RECEIVING:
2558 if (connection->read_buffer_offset == connection->read_buffer_size) 2558 if (connection->read_buffer_offset == connection->read_buffer_size)
2559 { 2559 {
2560 const bool internal_poll = (0 != (connection->daemon->options 2560 const bool internal_poll = (0 != (connection->daemon->options
@@ -4173,7 +4173,7 @@ MHD_connection_handle_read (struct MHD_Connection *connection,
4173 case MHD_CONNECTION_HEADERS_RECEIVED: 4173 case MHD_CONNECTION_HEADERS_RECEIVED:
4174 case MHD_CONNECTION_HEADERS_PROCESSED: 4174 case MHD_CONNECTION_HEADERS_PROCESSED:
4175 case MHD_CONNECTION_CONTINUE_SENDING: 4175 case MHD_CONNECTION_CONTINUE_SENDING:
4176 case MHD_CONNECTION_CONTINUE_SENT: 4176 case MHD_CONNECTION_BODY_RECEIVING:
4177 case MHD_CONNECTION_BODY_RECEIVED: 4177 case MHD_CONNECTION_BODY_RECEIVED:
4178 case MHD_CONNECTION_FOOTER_PART_RECEIVED: 4178 case MHD_CONNECTION_FOOTER_PART_RECEIVED:
4179 case MHD_CONNECTION_FOOTERS_RECEIVED: 4179 case MHD_CONNECTION_FOOTERS_RECEIVED:
@@ -4297,7 +4297,7 @@ MHD_connection_handle_write (struct MHD_Connection *connection)
4297 connection->continue_message_write_offset += (size_t) ret; 4297 connection->continue_message_write_offset += (size_t) ret;
4298 MHD_update_last_activity_ (connection); 4298 MHD_update_last_activity_ (connection);
4299 return; 4299 return;
4300 case MHD_CONNECTION_CONTINUE_SENT: 4300 case MHD_CONNECTION_BODY_RECEIVING:
4301 case MHD_CONNECTION_BODY_RECEIVED: 4301 case MHD_CONNECTION_BODY_RECEIVED:
4302 case MHD_CONNECTION_FOOTER_PART_RECEIVED: 4302 case MHD_CONNECTION_FOOTER_PART_RECEIVED:
4303 case MHD_CONNECTION_FOOTERS_RECEIVED: 4303 case MHD_CONNECTION_FOOTERS_RECEIVED:
@@ -4941,7 +4941,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
4941 } 4941 }
4942 connection->state = (0 == connection->rq.remaining_upload_size) 4942 connection->state = (0 == connection->rq.remaining_upload_size)
4943 ? MHD_CONNECTION_FULL_REQ_RECEIVED 4943 ? MHD_CONNECTION_FULL_REQ_RECEIVED
4944 : MHD_CONNECTION_CONTINUE_SENT; 4944 : MHD_CONNECTION_BODY_RECEIVING;
4945 if (connection->suspended) 4945 if (connection->suspended)
4946 break; 4946 break;
4947 continue; 4947 continue;
@@ -4949,17 +4949,17 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
4949 if (connection->continue_message_write_offset == 4949 if (connection->continue_message_write_offset ==
4950 MHD_STATICSTR_LEN_ (HTTP_100_CONTINUE)) 4950 MHD_STATICSTR_LEN_ (HTTP_100_CONTINUE))
4951 { 4951 {
4952 connection->state = MHD_CONNECTION_CONTINUE_SENT; 4952 connection->state = MHD_CONNECTION_BODY_RECEIVING;
4953 continue; 4953 continue;
4954 } 4954 }
4955 break; 4955 break;
4956 case MHD_CONNECTION_CONTINUE_SENT: 4956 case MHD_CONNECTION_BODY_RECEIVING:
4957 if (0 != connection->read_buffer_offset) 4957 if (0 != connection->read_buffer_offset)
4958 { 4958 {
4959 process_request_body (connection); /* loop call */ 4959 process_request_body (connection); /* loop call */
4960 if (connection->discard_request) 4960 if (connection->discard_request)
4961 { 4961 {
4962 mhd_assert (MHD_CONNECTION_CONTINUE_SENT != connection->state); 4962 mhd_assert (MHD_CONNECTION_BODY_RECEIVING != connection->state);
4963 continue; 4963 continue;
4964 } 4964 }
4965 } 4965 }
diff --git a/src/microhttpd/internal.c b/src/microhttpd/internal.c
index dee21e9e..6f80b984 100644
--- a/src/microhttpd/internal.c
+++ b/src/microhttpd/internal.c
@@ -1,6 +1,7 @@
1/* 1/*
2 This file is part of libmicrohttpd 2 This file is part of libmicrohttpd
3 Copyright (C) 2007 Daniel Pittman and Christian Grothoff 3 Copyright (C) 2007 Daniel Pittman and Christian Grothoff
4 Copyright (C) 2015-2021 Evgeny Grin (Karlson2k)
4 5
5 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public 7 modify it under the terms of the GNU Lesser General Public
@@ -22,6 +23,7 @@
22 * @brief internal shared structures 23 * @brief internal shared structures
23 * @author Daniel Pittman 24 * @author Daniel Pittman
24 * @author Christian Grothoff 25 * @author Christian Grothoff
26 * @author Karlson2k (Evgeny Grin)
25 */ 27 */
26 28
27#include "internal.h" 29#include "internal.h"
@@ -51,8 +53,8 @@ MHD_state_to_string (enum MHD_CONNECTION_STATE state)
51 return "headers processed"; 53 return "headers processed";
52 case MHD_CONNECTION_CONTINUE_SENDING: 54 case MHD_CONNECTION_CONTINUE_SENDING:
53 return "continue sending"; 55 return "continue sending";
54 case MHD_CONNECTION_CONTINUE_SENT: 56 case MHD_CONNECTION_BODY_RECEIVING:
55 return "continue sent"; 57 return "body receiving";
56 case MHD_CONNECTION_BODY_RECEIVED: 58 case MHD_CONNECTION_BODY_RECEIVED:
57 return "body received"; 59 return "body received";
58 case MHD_CONNECTION_FOOTER_PART_RECEIVED: 60 case MHD_CONNECTION_FOOTER_PART_RECEIVED:
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 1565c21f..990552b7 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -649,12 +649,12 @@ enum MHD_CONNECTION_STATE
649 /** 649 /**
650 * We have sent 100 CONTINUE (or do not need to). Read the message body. 650 * We have sent 100 CONTINUE (or do not need to). Read the message body.
651 */ 651 */
652 MHD_CONNECTION_CONTINUE_SENT = MHD_CONNECTION_CONTINUE_SENDING + 1, 652 MHD_CONNECTION_BODY_RECEIVING = MHD_CONNECTION_CONTINUE_SENDING + 1,
653 653
654 /** 654 /**
655 * We got the request body. Wait for a line of the footer. 655 * We got the request body. Wait for a line of the footer.
656 */ 656 */
657 MHD_CONNECTION_BODY_RECEIVED = MHD_CONNECTION_CONTINUE_SENT + 1, 657 MHD_CONNECTION_BODY_RECEIVED = MHD_CONNECTION_BODY_RECEIVING + 1,
658 658
659 /** 659 /**
660 * We got part of a line of the footer. Wait for the 660 * We got part of a line of the footer. Wait for the