From ec8aedc77bbaa293dc76d2aba98fc8ce1243cf68 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 12 Apr 2008 21:16:28 +0000 Subject: msgs --- src/daemon/connection.c | 22 ++++++++++++++++++++++ src/testcurl/daemontest_long_header.c | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/daemon/connection.c b/src/daemon/connection.c index ae93ff05..6246ee21 100644 --- a/src/daemon/connection.c +++ b/src/daemon/connection.c @@ -50,7 +50,11 @@ * Intentionally empty here to keep our memory footprint * minimal. */ +#if HAVE_MESSAGES +#define REQUEST_TOO_BIG "Request too bigYour HTTP header was too big for the memory constraints of this webserver." +#else #define REQUEST_TOO_BIG "" +#endif /** * Response text used when the request (http header) does not @@ -59,7 +63,11 @@ * Intentionally empty here to keep our memory footprint * minimal. */ +#if HAVE_MESSAGES +#define REQUEST_LACKS_HOST ""Host:" header requiredIn HTTP 1.1, requests must include a "Host:" header, and your HTTP 1.1 request lacked such a header." +#else #define REQUEST_LACKS_HOST "" +#endif /** * Response text used when the request (http header) is @@ -68,7 +76,11 @@ * Intentionally empty here to keep our memory footprint * minimal. */ +#if HAVE_MESSAGES +#define REQUEST_MALFORMED "Request malformedYour HTTP request was syntactically incorrect." +#else #define REQUEST_MALFORMED "" +#endif #define EXTRA_CHECKS MHD_YES @@ -1627,6 +1639,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) line = get_next_header_line (connection); if (line == NULL) { + if (connection->state != MHD_CONNECTION_INIT) + continue; if (connection->read_closed) { connection->state = MHD_CONNECTION_CLOSED; @@ -1643,6 +1657,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) line = get_next_header_line (connection); if (line == NULL) { + if (connection->state != MHD_CONNECTION_URL_RECEIVED) + continue; if (connection->read_closed) { connection->state = MHD_CONNECTION_CLOSED; @@ -1668,6 +1684,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) line = get_next_header_line (connection); if (line == NULL) { + if (connection->state != MHD_CONNECTION_HEADER_PART_RECEIVED) + continue; if (connection->read_closed) { connection->state = MHD_CONNECTION_CLOSED; @@ -1734,6 +1752,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) line = get_next_header_line (connection); if (line == NULL) { + if (connection->state != MHD_CONNECTION_BODY_RECEIVED) + continue; if (connection->read_closed) { connection->state = MHD_CONNECTION_CLOSED; @@ -1759,6 +1779,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) line = get_next_header_line (connection); if (line == NULL) { + if (connection->state != MHD_CONNECTION_FOOTER_PART_RECEIVED) + continue; if (connection->read_closed) { connection->state = MHD_CONNECTION_CLOSED; diff --git a/src/testcurl/daemontest_long_header.c b/src/testcurl/daemontest_long_header.c index 385b9776..bfdc02e8 100644 --- a/src/testcurl/daemontest_long_header.c +++ b/src/testcurl/daemontest_long_header.c @@ -99,7 +99,7 @@ testLongUrlGet () cbc.buf = buf; cbc.size = 2048; cbc.pos = 0; - d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY /* | MHD_USE_DEBUG */ , + d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY /* | MHD_USE_DEBUG */, 1080, &apc_all, NULL, @@ -219,7 +219,7 @@ testLongHeaderGet () MHD_stop_daemon (d); free (url); if (code != MHD_HTTP_REQUEST_ENTITY_TOO_LARGE) - return 128; + return 128; return 0; } -- cgit v1.2.3