journald: properly process multiple entries in the same native packet
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 14 May 2017 02:34:40 +0000 (22:34 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 May 2017 17:02:17 +0000 (13:02 -0400)
commit68944f196bc85b067de71c4fe1631d824d0aded5
treed2f0c80a308ed678453cb07a6080839e02beae64
parent8924973ae2e1f0a0c131dcec0578669dc26e5e26
journald: properly process multiple entries in the same native packet

For all except the last entry in a single packet, we would dispatch the
message to the journal, but not forward it, nor perform proper cleanup.
Rewrite the code to process each entry in a helper function, and make
server_process_native_message() just call this function in a loop.

Fixes #5643.

v2:
- properly decrement *remaining when processing entry separator
src/journal/journald-native.c