Skip to content

Commit

Permalink
Merge pull request #121 from przemyslawzygmunt/master
Browse files Browse the repository at this point in the history
When a stream socket peer has performed an orderly shutdown, the retu…
  • Loading branch information
LiamBindle committed Jan 28, 2021
2 parents baf6d3d + e5e4ee6 commit 229a907
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mqtt_pal.c
Expand Up @@ -332,7 +332,7 @@ ssize_t mqtt_pal_recvall(mqtt_pal_socket_handle fd, void* buf, size_t bufsz, int
/* successfully read bytes from the socket */
buf += rv;
bufsz -= rv;
} else if (rv < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
} else if (rv == 0 || (rv < 0 && errno != EAGAIN && errno != EWOULDBLOCK)) {
/* an error occurred that wasn't "nothing to read". */
return MQTT_ERROR_SOCKET_ERROR;
}
Expand Down

0 comments on commit 229a907

Please sign in to comment.