blob: 9e3d64bbf21ec53c250f853eb8527db419cd3c89 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001logwriter: Don't allocate a new buffer if fails to consume current item
2
3Upstream-Status: Pending
4
5Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
6---
7--- a/lib/logwriter.c
8+++ b/lib/logwriter.c
9@@ -1010,7 +1010,7 @@
10 {
11 status = log_proto_client_post(proto, (guchar *) self->line_buffer->str, self->line_buffer->len, &consumed);
12
13- if (consumed)
14+ if (consumed && status != LPS_ERROR)
15 log_writer_realloc_line_buffer(self);
16
17 if (status == LPS_ERROR)
18@@ -1028,7 +1028,7 @@
19 NULL);
20 consumed = TRUE;
21 }
22- if (consumed)
23+ if (consumed && status != LPS_ERROR)
24 {
25 if (lm->flags & LF_LOCAL)
26 step_sequence_number(&self->seq_num);