summaryrefslogtreecommitdiffstats
path: root/src/core.c
diff options
context:
space:
mode:
authortiptorrent development team <tiptorrent@soleta.eu>2021-09-10 17:07:06 +0200
committertiptorrent development team <tiptorrent@soleta.eu>2021-09-29 15:48:07 +0200
commitd0c8b24985e365d65cf0ac1a1090858d84c53428 (patch)
tree1c859351e1913c52684b9169b13e6153fab37260 /src/core.c
parent9cf3edf10f79335b65ceb9599f10483557d48047 (diff)
do not display an error when recv() == 0
This is the client closing the connection with us.
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core.c b/src/core.c
index 9823c7a..ef730ac 100644
--- a/src/core.c
+++ b/src/core.c
@@ -98,13 +98,10 @@ static int tip_client_recv(struct tip_client *cli, int events)
ret = recv(io->fd, cli->buf + cli->buf_len,
sizeof(cli->buf) - cli->buf_len, 0);
- if (ret <= 0) {
- if (ret < 0) {
- syslog(LOG_ERR, "error reading from client %s:%hu (%s)\n",
- inet_ntoa(cli->addr.sin_addr), ntohs(cli->addr.sin_port),
- strerror(errno));
- }
- return ret;
+ if (ret < 0) {
+ syslog(LOG_ERR, "error reading from client %s:%hu (%s)\n",
+ inet_ntoa(cli->addr.sin_addr), ntohs(cli->addr.sin_port),
+ strerror(errno));
}
return ret;