Browse Source

Only assume clients have disconnected on an error from recv

master
Con Kolivas 11 years ago
parent
commit
328a85c1fe
  1. 7
      src/connector.c

7
src/connector.c

@ -110,11 +110,8 @@ retry:
buflen = PAGESIZE - client->bufofs; buflen = PAGESIZE - client->bufofs;
ret = recv(client->fd, client->buf + client->bufofs, buflen, MSG_DONTWAIT); ret = recv(client->fd, client->buf + client->bufofs, buflen, MSG_DONTWAIT);
if (ret < 1) { if (ret < 1) {
/* If we're reading on the first pass, there is supposed to be /* Nothing else ready to be read */
* data waiting for us according to poll() so no data implies if (!ret)
* a lost connection. On repeat reads may have just read all
* the data */
if (moredata)
return; return;
LOGINFO("Client fd %d disconnected", client->fd); LOGINFO("Client fd %d disconnected", client->fd);

Loading…
Cancel
Save