aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r--src/microhttpd/connection.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 228af49b..4753d6eb 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1831,7 +1831,7 @@ call_connection_handler (struct MHD_Connection *connection)
1831 processed = 0; 1831 processed = 0;
1832 connection->client_aware = true; 1832 connection->client_aware = true;
1833 if (MHD_NO == 1833 if (MHD_NO ==
1834 connection->daemon->default_handler (connection->daemon-> default_handler_cls, 1834 connection->daemon->default_handler (connection->daemon->default_handler_cls,
1835 connection, 1835 connection,
1836 connection->url, 1836 connection->url,
1837 connection->method, 1837 connection->method,
@@ -2857,6 +2857,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
2857 if (0 == line[0]) 2857 if (0 == line[0])
2858 { 2858 {
2859 connection->state = MHD_CONNECTION_HEADERS_RECEIVED; 2859 connection->state = MHD_CONNECTION_HEADERS_RECEIVED;
2860 connection->header_size = (size_t) (line - connection->read_buffer);
2860 continue; 2861 continue;
2861 } 2862 }
2862 if (MHD_NO == process_header_line (connection, 2863 if (MHD_NO == process_header_line (connection,
@@ -2892,6 +2893,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
2892 if (0 == line[0]) 2893 if (0 == line[0])
2893 { 2894 {
2894 connection->state = MHD_CONNECTION_HEADERS_RECEIVED; 2895 connection->state = MHD_CONNECTION_HEADERS_RECEIVED;
2896 connection->header_size = (size_t) (line - connection->read_buffer);
2895 continue; 2897 continue;
2896 } 2898 }
2897 continue; 2899 continue;
@@ -3402,6 +3404,12 @@ MHD_get_connection_info (struct MHD_Connection *connection,
3402 case MHD_CONNECTION_INFO_CONNECTION_TIMEOUT: 3404 case MHD_CONNECTION_INFO_CONNECTION_TIMEOUT:
3403 connection->connection_timeout_dummy = (unsigned int)connection->connection_timeout; 3405 connection->connection_timeout_dummy = (unsigned int)connection->connection_timeout;
3404 return (const union MHD_ConnectionInfo *) &connection->connection_timeout_dummy; 3406 return (const union MHD_ConnectionInfo *) &connection->connection_timeout_dummy;
3407 case MHD_CONNECTION_INFO_REQUEST_HEADER_SIZE:
3408 if ( (MHD_CONNECTION_HEADERS_RECEIVED > connection->state) ||
3409 (MHD_CONNECTION_CLOSED == connection->state) ||
3410 (MHD_CONNECTION_IN_CLEANUP == connection->state) )
3411 return NULL; /* invalid, too early! */
3412 return (const union MHD_ConnectionInfo *) &connection->header_size;
3405 default: 3413 default:
3406 return NULL; 3414 return NULL;
3407 } 3415 }