Browse Source

Reinstate checking for zero as a return from recv for cleanly disconnected clients

master
Con Kolivas 10 years ago
parent
commit
bf72ebbee6
  1. 5
      src/connector.c

5
src/connector.c

@ -335,8 +335,9 @@ retry:
buflen = PAGESIZE - client->bufofs;
ret = recv(client->fd, client->buf + client->bufofs, buflen, 0);
if (ret < 1) {
if (!ret)
return;
/* We should have something to read if called since poll set
* this fd's revents status so if there's nothing it means the
* client has disconnected. */
LOGINFO("Client fd %d disconnected - recv fail with bufofs %d ret %d errno %d %s",
client->fd, client->bufofs, ret, errno, ret && errno ? strerror(errno) : "");
invalidate_client(ckp, cdata, client);

Loading…
Cancel
Save