Skip to content

Commit

Permalink
zmq: added queue to source
Browse files Browse the repository at this point in the history
 * ZMQ contains flow-control itself
 * The queue is necessary to set path_options to not bother about
   acknowledgement
 * Previously there was a bug which ended in a segfault. After the first
   reload and message sending syslog-ng crashed because the bookmark
   wasn't set properly.
  • Loading branch information
lmesz committed Nov 27, 2015
1 parent b9e909d commit a1cf3c4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/zmq/zmq-source.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
*/


#include <zmq.h>

#include "zmq-module.h"
Expand Down Expand Up @@ -225,6 +226,14 @@ zmq_sd_free(LogPipe *s)
log_src_driver_free(s);
}

static void
zmq_sd_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options, gpointer user_data)
{
LogPathOptions *path_opt = path_options;
path_opt->ack_needed = FALSE;
log_src_driver_queue_method(s, msg, path_opt, user_data);
}

LogDriver *
zmq_sd_new(GlobalConfig *cfg)
{
Expand All @@ -233,6 +242,7 @@ zmq_sd_new(GlobalConfig *cfg)
log_src_driver_init_instance(&self->super, cfg);

self->super.super.super.init = zmq_sd_init;
self->super.super.super.queue = zmq_sd_queue;
self->super.super.super.deinit = zmq_sd_deinit;
self->super.super.super.notify = zmq_sd_notify;
self->super.super.super.free_fn = zmq_sd_free;
Expand Down

0 comments on commit a1cf3c4

Please sign in to comment.