1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-31 07:51:21 +03:00

journald: properly sum up entry size counter

We should read the entry size before moving to the next iovec, not
after.
This commit is contained in:
Lennart Poettering 2014-08-05 03:37:56 +02:00
parent dc4d47e2c7
commit a174f94d52

View File

@ -153,8 +153,8 @@ void server_process_native_message(
* field */
iovec[n].iov_base = (char*) p;
iovec[n].iov_len = l;
n++;
entry_size += iovec[n].iov_len;
n++;
/* We need to determine the priority
* of this entry for the rate limiting
@ -246,8 +246,8 @@ void server_process_native_message(
if (valid_user_field(p, e - p, false)) {
iovec[n].iov_base = k;
iovec[n].iov_len = (e - p) + 1 + l;
n++;
entry_size += iovec[n].iov_len;
n++;
} else
free(k);