summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-09-20 22:24:18 +0200
committerMichael Adam <obnox@samba.org>2009-09-20 22:24:18 +0200
commitb95f7b9ffb8bca8a2b9b7a2654602d2207299a1c (patch)
treec0585d995ce7c4d2fbb3a0a645bf30119cd92c49 /src
parentfcb053a77cc892ebe92be8f7baff60f358189368 (diff)
Print a http error when the client headers could not be retrieved.
A ususal case here is that the headers were buggy, e.g. a line without a ":" to separate the header field name from the value. Previous behaviour was to silently return a blank page. Michael
Diffstat (limited to 'src')
-rw-r--r--src/reqs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/reqs.c b/src/reqs.c
index 282d014..2f682b3 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -1597,6 +1597,11 @@ void handle_connection (int fd)
if (get_all_headers (connptr->client_fd, hashofheaders) < 0) {
log_message (LOG_WARNING,
"Could not retrieve all the headers from the client");
+ indicate_http_error (connptr, 400, "Bad Request",
+ "detail",
+ "Could not retrieve all the headers from "
+ "the client.", NULL);
+ send_http_error_message (connptr);
hashmap_delete (hashofheaders);
update_stats (STAT_BADCONN);
destroy_conn (connptr);