increased the web request max size from 8192 to 16384, #126
Costa Tsaousis (ktsaou) committed
Apr 2, 2016 at 06:54 UTC
5e70ebddea06c2a5b984fff301cbe2aa19fa31c9
1 file changed
+4
-3
src/web_client.c
+4
-3
@@ -30,6 +30,7 @@
30
31
#define INITIAL_WEB_DATA_LENGTH 16384
32
#define WEB_REQUEST_LENGTH 16384
33
+#define TOO_BIG_REQUEST 16384
34
35
int web_client_timeout = DEFAULT_DISCONNECT_IDLE_WEB_CLIENTS_AFTER_SECONDS;
36
int web_enable_gzip = 1;
@@ -1192,14 +1193,14 @@ void web_client_process(struct web_client *w) {
1193
// free url_decode() buffer
1194
if(pointer_to_free) free(pointer_to_free);
1195
}
1195
- else if(w->response.data->len > 8192) {
1196
+ else if(w->response.data->len > TOO_BIG_REQUEST) {
1197
strcpy(w->last_url, "too big request");
1198
1198
- debug(D_WEB_CLIENT_ACCESS, "%llu: Received request is too big.", w->id);
1199
+ debug(D_WEB_CLIENT_ACCESS, "%llu: Received request is too big (%zd bytes).", w->id, w->response.data->len);
1200
1201
code = 400;
1202
buffer_flush(w->response.data);
1202
- buffer_strcat(w->response.data, "Received request is too big.\r\n");
1203
+ buffer_sprintf(w->response.data, "Received request is too big (%zd bytes).\r\n", w->response.data->len);
1204
}
1205
else {
1206
// wait for more data