diff options
Diffstat (limited to 'meta-oe/recipes-support/syslog-ng/files/logwriter-still-free-the-unconsumed-item.patch')
-rw-r--r-- | meta-oe/recipes-support/syslog-ng/files/logwriter-still-free-the-unconsumed-item.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/syslog-ng/files/logwriter-still-free-the-unconsumed-item.patch b/meta-oe/recipes-support/syslog-ng/files/logwriter-still-free-the-unconsumed-item.patch new file mode 100644 index 0000000000..31110933f0 --- /dev/null +++ b/meta-oe/recipes-support/syslog-ng/files/logwriter-still-free-the-unconsumed-item.patch @@ -0,0 +1,47 @@ +logwritter: still free the unconsumed item during reloading configuration + +Otherwise we have no chance to free this stuff. + +Upstream-Status: Pending + +Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com> +--- +--- a/lib/logwriter.c ++++ b/lib/logwriter.c +@@ -39,6 +39,7 @@ + #include <iv.h> + #include <iv_event.h> + #include <iv_work.h> ++#include "logproto/logproto-text-client.h" + + typedef enum + { +@@ -978,6 +979,7 @@ + gint count = 0; + gboolean ignore_throttle = (flush_mode >= LW_FLUSH_QUEUE); + LogProtoStatus status = LPS_SUCCESS; ++ LogProtoTextClient *self_text; + + if (!proto) + return FALSE; +@@ -1035,7 +1037,18 @@ + } + else + { +- /* push back to the queue */ +- log_queue_push_head(self->queue, lm, &path_options); ++ self_text = (LogProtoTextClient *) proto; ++ /* free the unconsumed message during reloading configuration */ ++ if ((LW_FLUSH_QUEUE == flush_mode) && self_text->partial_free && self_text->partial) ++ { ++ self_text->partial_free(self_text->partial); ++ self_text->partial = NULL; ++ log_msg_unref(lm); ++ } ++ else ++ { ++ /* push back to the queue */ ++ log_queue_push_head(self->queue, lm, &path_options); ++ } + msg_set_context(NULL); + log_msg_refcache_stop(); |