# HG changeset patch # User Christian Brabandt # Date 1457298004 -3600 # Node ID 4e22d0e7bfb1bd42fef0c920188b0db410569af8 # Parent fd9a8463b059c4052e0019e7124affcd6c87b2fe commit https://github.com/vim/vim/commit/d0b6502a7ace39d6cd30874110a572371d10beae Author: Bram Moolenaar Date: Sun Mar 6 21:50:33 2016 +0100 patch 7.4.1505 Problem: When channel log is enabled get too many "looking for messages" log entries. Solution: Only give the message after another message. diff --git a/src/channel.c b/src/channel.c --- a/src/channel.c +++ b/src/channel.c @@ -136,6 +136,8 @@ ch_log_lead(char *what, channel_T *ch) } } +static int did_log_msg = TRUE; + void ch_log(channel_T *ch, char *msg) { @@ -145,6 +147,7 @@ ch_log(channel_T *ch, char *msg) fputs(msg, log_fd); fputc('\n', log_fd); fflush(log_fd); + did_log_msg = TRUE; } } @@ -157,6 +160,7 @@ ch_logn(channel_T *ch, char *msg, int nr fprintf(log_fd, msg, nr); fputc('\n', log_fd); fflush(log_fd); + did_log_msg = TRUE; } } @@ -169,6 +173,7 @@ ch_logs(channel_T *ch, char *msg, char * fprintf(log_fd, msg, name); fputc('\n', log_fd); fflush(log_fd); + did_log_msg = TRUE; } } @@ -181,6 +186,7 @@ ch_logsn(channel_T *ch, char *msg, char fprintf(log_fd, msg, name, nr); fputc('\n', log_fd); fflush(log_fd); + did_log_msg = TRUE; } } @@ -193,6 +199,7 @@ ch_error(channel_T *ch, char *msg) fputs(msg, log_fd); fputc('\n', log_fd); fflush(log_fd); + did_log_msg = TRUE; } } @@ -205,6 +212,7 @@ ch_errorn(channel_T *ch, char *msg, int fprintf(log_fd, msg, nr); fputc('\n', log_fd); fflush(log_fd); + did_log_msg = TRUE; } } @@ -217,6 +225,7 @@ ch_errors(channel_T *ch, char *msg, char fprintf(log_fd, msg, arg); fputc('\n', log_fd); fflush(log_fd); + did_log_msg = TRUE; } } @@ -2352,6 +2361,7 @@ channel_send(channel_T *channel, int par ignored = (int)fwrite(buf, len, 1, log_fd); fprintf(log_fd, "'\n"); fflush(log_fd); + did_log_msg = TRUE; } if (part == PART_SOCK) @@ -2541,7 +2551,13 @@ channel_parse_messages(void) int r; int part = PART_SOCK; - ch_log(NULL, "looking for messages on channels"); + /* Only do this message when another message was given, otherwise we get + * lots of them. */ + if (did_log_msg) + { + ch_log(NULL, "looking for messages on channels"); + did_log_msg = FALSE; + } while (channel != NULL) { if (channel->ch_refcount == 0 && !channel_still_useful(channel)) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -744,6 +744,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1505, +/**/ 1504, /**/ 1503,