diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-28 18:38:01 +0200 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-28 18:38:01 +0200 |
commit | 68c2bac8aa365676b4dd04597bfd937f7a214aa4 (patch) | |
tree | 0538a612cbb97534aa7e4014bfe8edd17db36bab | |
parent | d72af7a9b9af070294ae231fa860f373cf15822e (diff) |
Disconnect clients if there was no valid HTTP request after 1MB of data
-rw-r--r-- | http-launch/src/http-launch.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/http-launch/src/http-launch.c b/http-launch/src/http-launch.c index 238385f..7b02890 100644 --- a/http-launch/src/http-launch.c +++ b/http-launch/src/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 { |