aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/connection.c
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-03-10 16:59:56 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-03-10 17:02:25 +0300
commite74fad60005e8fb18b67ea77e84c9875a94d18a3 (patch)
treef37a402851766735c3b887aaac488c2ddb7f48cc /src/microhttpd/connection.c
parentb9743114cf6d4584968cfbfd3fdac95c14c1c692 (diff)
downloadlibmicrohttpd-e74fad60005e8fb18b67ea77e84c9875a94d18a3.tar.gz
libmicrohttpd-e74fad60005e8fb18b67ea77e84c9875a94d18a3.zip
Added warning in log if application-defined Content-Length is used
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r--src/microhttpd/connection.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 9611e0a7..e16d5ed1 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1,7 +1,7 @@
1/* 1/*
2 This file is part of libmicrohttpd 2 This file is part of libmicrohttpd
3 Copyright (C) 2007-2020 Daniel Pittman and Christian Grothoff 3 Copyright (C) 2007-2020 Daniel Pittman and Christian Grothoff
4 Copyright (C) 2015-2021 Evgeny Grin (Karlson2k) 4 Copyright (C) 2015-2022 Evgeny Grin (Karlson2k)
5 5
6 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public 7 modify it under the terms of the GNU Lesser General Public
@@ -5265,6 +5265,18 @@ MHD_queue_response (struct MHD_Connection *connection,
5265 } 5265 }
5266 } 5266 }
5267 5267
5268#ifdef HAVE_MESSAGES
5269 if ( (0 != (MHD_RF_INSANITY_HEADER_CONTENT_LENGTH & response->flags)) &&
5270 (0 != (MHD_RAF_HAS_CONTENT_LENGTH & response->flags_auto)) )
5271 {
5272 MHD_DLOG (daemon,
5273 _ ("The response has application-defined \"Content-Length\" " \
5274 "header. The reply to the request will be not " \
5275 "HTTP-compliant and may result in hung connection or " \
5276 "other problems!\n"));
5277 }
5278#endif
5279
5268 MHD_increment_response_rc (response); 5280 MHD_increment_response_rc (response);
5269 connection->response = response; 5281 connection->response = response;
5270 connection->responseCode = status_code; 5282 connection->responseCode = status_code;