From 1b03a9c6a443eddcff709b4e7c97dbab3eb9534b Mon Sep 17 00:00:00 2001 From: dormando Date: Sun, 12 Jun 2016 18:29:44 -0700 Subject: poll() smarter when full, print skipped count When lines are skipped to a watcher, a [skipped: n] is printed before resuming. Also polls full watcher directly once, and will wait until the outer loop to re-poll. Think the routine can be simplified... it works so will leave it and revisit later. --- logger.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'logger.h') diff --git a/logger.h b/logger.h index c55186e..9aa8539 100644 --- a/logger.h +++ b/logger.h @@ -82,10 +82,10 @@ enum logger_watcher_type { typedef struct { void *c; /* original connection structure. still with source thread attached */ - int chunks; /* count of chunks stored up */ int sfd; /* client fd */ - uint64_t skipped; /* lines skipped since last successful print */ int id; /* id number for watcher list */ + uint64_t skipped; /* lines skipped since last successful print */ + bool failed_flush; /* recently failed to write out (EAGAIN), wait before retry */ enum logger_watcher_type t; /* stderr, client, syslog, etc */ uint16_t eflags; /* flags we are interested in */ bipbuf_t *buf; /* per-watcher output buffer */ -- cgit v1.2.1