author | Sebastian Harl <sh@tokkee.org> | |
Tue, 29 Jul 2014 20:49:44 +0000 (22:49 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 29 Jul 2014 20:49:44 +0000 (22:49 +0200) | ||
commit | 873812bad1b030d79da6402ed6d26d008179592d | |
tree | 013e7612c934f4efd5f06c7a1863a75c8d8f1f15 | tree | snapshot |
parent | ab0cdca7fb4f505307f5f0fc4cdcb3ef804e32d8 | commit | diff |
store: Fixed JSON serialization when skipping hosts due to filters.
Previously, it might have happened that a comma was appended to a list of
hosts even though all subsequent hosts were filtered out. This created invalid
JSON. Now, don't let sdb_store_host_tojson ignore hosts entirely. Instead,
always let it serialize the host passed to the function and only pass on the
filter to child objects. The caller is now responsible for calling the filter
and, at the same time, the caller is able to correctly handle skipped hosts.
Fixed the unit-test which should have caught this.
Previously, it might have happened that a comma was appended to a list of
hosts even though all subsequent hosts were filtered out. This created invalid
JSON. Now, don't let sdb_store_host_tojson ignore hosts entirely. Instead,
always let it serialize the host passed to the function and only pass on the
filter to child objects. The caller is now responsible for calling the filter
and, at the same time, the caller is able to correctly handle skipped hosts.
Fixed the unit-test which should have caught this.
src/core/store.c | diff | blob | history | |
src/include/core/store.h | diff | blob | history | |
t/unit/core/store_test.c | diff | blob | history |