diff --git a/src/generator.c b/src/generator.c index 85705a47..525c7ec5 100644 --- a/src/generator.c +++ b/src/generator.c @@ -1756,7 +1756,7 @@ static void send_json_msgq(gdata_t *gdata, cs_msg_t **csmsgq) fd = proxy->cs.fd; ret = send(fd, csmsg->buf + csmsg->ofs, csmsg->len, MSG_DONTWAIT); if (ret < 1) { - if (errno == EAGAIN || errno == EWOULDBLOCK || !ret) + if (!ret || errno == EAGAIN || errno == EWOULDBLOCK) break; csmsg->len = 0; LOGNOTICE("Proxy %d:%d %s failed to send msg in send_json_msgq, dropping",