network/http-launch: Disconnect clients if there was no valid HTTP request after...
authorSebastian Dröge <slomo@circular-chaos.org>
Sun, 28 Jul 2013 16:38:01 +0000 (18:38 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Sun, 28 Jul 2013 16:38:01 +0000 (18:38 +0200)
network/http-launch/http-launch.c

index 238385f..7b02890 100644 (file)
@@ -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 {