1 commit 528176910ee1d00278e4108cc23d9f4f2de8a639
2 Author: Alessio Caiazza <nolith@abisso.org>
3 Date: Wed May 14 22:45:33 2014 +0200
5 Hotfix for very long http headers also for jsoninfo
7 diff --git a/lib/jsoninfo/src/olsrd_jsoninfo.c b/lib/jsoninfo/src/olsrd_jsoninfo.c
8 index 966292c..817c64a 100644
9 --- a/lib/jsoninfo/src/olsrd_jsoninfo.c
10 +++ b/lib/jsoninfo/src/olsrd_jsoninfo.c
11 @@ -508,8 +508,15 @@ ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int flags __att
13 FD_SET((unsigned int)ipc_connection, &rfds); /* Win32 needs the cast here */
14 if (0 <= select(ipc_connection + 1, &rfds, NULL, NULL, &tv)) {
16 - ssize_t s = recv(ipc_connection, (void *)&requ, sizeof(requ), 0); /* Win32 needs the cast here */
18 + ssize_t s = recv(ipc_connection, (void *)&requ, sizeof(requ)-1, 0); /* Win32 needs the cast here */
20 + if (s == sizeof(requ)-1) {
21 + /* input was too much long, just skip the rest */
24 + while (recv(ipc_connection, (void *)&dummy, sizeof(dummy), 0) == sizeof(dummy), 0);
28 /* print out the requested tables */