Browse Source

Check for !ret set before checking errno as it may not be set and cached from a previous error.

master
Con Kolivas 8 years ago
parent
commit
12a134c66b
  1. 2
      src/generator.c

2
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",

Loading…
Cancel
Save