From c650382b2da4231f05ff5338904528003e0a7be1 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 10 Aug 2014 09:59:55 +1000 Subject: [PATCH] Discard messages being sent to clients who error on select --- src/connector.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/connector.c b/src/connector.c index fd11a385..bbe4a237 100644 --- a/src/connector.c +++ b/src/connector.c @@ -374,6 +374,12 @@ void *sender(void *arg) * select on this one */ ret = wait_write_select(fd, 0); if (ret < 1) { + if (ret < 0) { + LOGDEBUG("Discarding message sent to interrupted client"); + free(sender_send->buf); + free(sender_send); + continue; + } LOGDEBUG("Client %d not ready for writes", client->id); /* Append it to the tail of the list */