52dfb0b50143e8982db0eae4c5fecc904a1f6dab
[lede-routing/.git] / olsrd / patches / 001-fix-jsoninfo.patch
1 diff --git a/lib/jsoninfo/src/olsrd_jsoninfo.c b/lib/jsoninfo/src/olsrd_jsoninfo.c
2 index 3f7b7b9..966292c 100644
3 --- a/lib/jsoninfo/src/olsrd_jsoninfo.c
4 +++ b/lib/jsoninfo/src/olsrd_jsoninfo.c
5 @@ -1283,7 +1283,7 @@ send_info(unsigned int send_what, int the_socket)
6    abuf_init(&abuf, 32768);
7  
8   // only add if outputing JSON
9 -  if (send_what & SIW_ALL) abuf_json_open_array_entry(&abuf);
10 +  if (send_what & SIW_ALL) abuf_puts(&abuf, "{");
11  
12    if ((send_what & SIW_LINKS) == SIW_LINKS) ipc_print_links(&abuf);
13    if ((send_what & SIW_NEIGHBORS) == SIW_NEIGHBORS) ipc_print_neighbors(&abuf);
14 @@ -1305,7 +1305,7 @@ send_info(unsigned int send_what, int the_socket)
15      abuf_json_int(&abuf, "timeSinceStartup", now_times);
16      if(*uuid != 0)
17        abuf_json_string(&abuf, "uuid", uuid);
18 -    abuf_json_close_array_entry(&abuf);
19 +      abuf_puts(&abuf, "}\n");
20    }
21  
22    /* this outputs the olsrd.conf text directly, not JSON */