diff options
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r-- | src/microhttpd/connection.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 104df287..c5f86cc2 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -2238,6 +2238,7 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection) | |||
2238 | switch (connection->state) | 2238 | switch (connection->state) |
2239 | { | 2239 | { |
2240 | case MHD_CONNECTION_INIT: | 2240 | case MHD_CONNECTION_INIT: |
2241 | case MHD_CONNECTION_REQ_LINE_RECEIVING: | ||
2241 | case MHD_CONNECTION_URL_RECEIVED: | 2242 | case MHD_CONNECTION_URL_RECEIVED: |
2242 | case MHD_CONNECTION_HEADER_PART_RECEIVED: | 2243 | case MHD_CONNECTION_HEADER_PART_RECEIVED: |
2243 | /* while reading headers, we always grow the | 2244 | /* while reading headers, we always grow the |
@@ -3529,6 +3530,7 @@ MHD_connection_handle_read (struct MHD_Connection *connection) | |||
3529 | switch (connection->state) | 3530 | switch (connection->state) |
3530 | { | 3531 | { |
3531 | case MHD_CONNECTION_INIT: | 3532 | case MHD_CONNECTION_INIT: |
3533 | case MHD_CONNECTION_REQ_LINE_RECEIVING: | ||
3532 | case MHD_CONNECTION_URL_RECEIVED: | 3534 | case MHD_CONNECTION_URL_RECEIVED: |
3533 | case MHD_CONNECTION_HEADER_PART_RECEIVED: | 3535 | case MHD_CONNECTION_HEADER_PART_RECEIVED: |
3534 | case MHD_CONNECTION_HEADERS_RECEIVED: | 3536 | case MHD_CONNECTION_HEADERS_RECEIVED: |
@@ -3597,6 +3599,7 @@ MHD_connection_handle_write (struct MHD_Connection *connection) | |||
3597 | switch (connection->state) | 3599 | switch (connection->state) |
3598 | { | 3600 | { |
3599 | case MHD_CONNECTION_INIT: | 3601 | case MHD_CONNECTION_INIT: |
3602 | case MHD_CONNECTION_REQ_LINE_RECEIVING: | ||
3600 | case MHD_CONNECTION_URL_RECEIVED: | 3603 | case MHD_CONNECTION_URL_RECEIVED: |
3601 | case MHD_CONNECTION_HEADER_PART_RECEIVED: | 3604 | case MHD_CONNECTION_HEADER_PART_RECEIVED: |
3602 | case MHD_CONNECTION_HEADERS_RECEIVED: | 3605 | case MHD_CONNECTION_HEADERS_RECEIVED: |
@@ -4103,6 +4106,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
4103 | switch (connection->state) | 4106 | switch (connection->state) |
4104 | { | 4107 | { |
4105 | case MHD_CONNECTION_INIT: | 4108 | case MHD_CONNECTION_INIT: |
4109 | case MHD_CONNECTION_REQ_LINE_RECEIVING: | ||
4106 | line = get_next_header_line (connection, | 4110 | line = get_next_header_line (connection, |
4107 | &line_len); | 4111 | &line_len); |
4108 | if (NULL != line) | 4112 | if (NULL != line) |
@@ -4110,8 +4114,11 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
4110 | /* Check for empty string, as we might want | 4114 | /* Check for empty string, as we might want |
4111 | to tolerate 'spurious' empty lines */ | 4115 | to tolerate 'spurious' empty lines */ |
4112 | if (0 == line[0]) | 4116 | if (0 == line[0]) |
4117 | { | ||
4113 | /* TODO: Add MHD option to not tolerate it */ | 4118 | /* TODO: Add MHD option to not tolerate it */ |
4119 | connection->state = MHD_CONNECTION_INIT; | ||
4114 | continue; /* Process the next line */ | 4120 | continue; /* Process the next line */ |
4121 | } | ||
4115 | if (MHD_NO == parse_initial_message_line (connection, | 4122 | if (MHD_NO == parse_initial_message_line (connection, |
4116 | line, | 4123 | line, |
4117 | line_len)) | 4124 | line_len)) |
@@ -4130,6 +4137,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
4130 | mhd_assert (MHD_CONNECTION_INIT != connection->state); | 4137 | mhd_assert (MHD_CONNECTION_INIT != connection->state); |
4131 | continue; | 4138 | continue; |
4132 | } | 4139 | } |
4140 | if (0 < connection->read_buffer_offset) | ||
4141 | connection->state = MHD_CONNECTION_REQ_LINE_RECEIVING; | ||
4133 | break; | 4142 | break; |
4134 | case MHD_CONNECTION_URL_RECEIVED: | 4143 | case MHD_CONNECTION_URL_RECEIVED: |
4135 | line = get_next_header_line (connection, | 4144 | line = get_next_header_line (connection, |