From e38e9ce609c5aae7404b71f14cc76492c3f2c2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 28 Jul 2013 18:38:01 +0200 Subject: [PATCH] network/http-launch: Disconnect clients if there was no valid HTTP request after 1MB of data --- network/http-launch/http-launch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/network/http-launch/http-launch.c b/network/http-launch/http-launch.c index 238385ff7b..7b0289056d 100644 --- a/network/http-launch/http-launch.c +++ b/network/http-launch/http-launch.c @@ -220,7 +220,11 @@ on_read_bytes (GPollableInputStream * stream, Client * client) } } - /* FIXME: If too large, disconnect client */ + if (client->current_message->len >= 1024 * 1024) { + g_print ("No complete request after 1MB of data\n"); + remove_client (client); + return FALSE; + } return TRUE; } else {