diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-08-05 03:37:56 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-08-05 04:14:02 +0200 |
commit | a174f94d529c7ae9be589867308b669ec9b4dcc0 (patch) | |
tree | a61942487ebf00ca76a93e676a98b47507bee369 | |
parent | dc4d47e2c79aafa3ef646e32ff3422c4ce935c1b (diff) |
journald: properly sum up entry size counter
We should read the entry size before moving to the next iovec, not
after.
-rw-r--r-- | src/journal/journald-native.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c index 6bc5df725e..aded998979 100644 --- a/src/journal/journald-native.c +++ b/src/journal/journald-native.c @@ -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); |