diff --git a/software/prj.conf b/software/prj.conf index faa5f28..27131df 100644 --- a/software/prj.conf +++ b/software/prj.conf @@ -2,7 +2,7 @@ CONFIG_LOG=y CONFIG_NET_LOG=y CONFIG_LOG_BUFFER_SIZE=1024 CONFIG_LOG_PRINTK=y -CONFIG_LOG_DEFAULT_LEVEL=4 +CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_NETWORKING=y CONFIG_NET_IPV4=y diff --git a/software/src/sock.c b/software/src/sock.c index 0c53329..e6ebc09 100644 --- a/software/src/sock.c +++ b/software/src/sock.c @@ -70,6 +70,8 @@ sock_read_buf(int sock, struct bufptr *bp, bool entire) { do { ssize_t l = zsock_recv(sock, bp->p, bp->left, 0); + if (l == 0) + return -ECONNRESET; if (l < 0) return -errno; @@ -88,6 +90,8 @@ sock_write_buf(int sock, struct bufptr *bp) */ while (bp->left) { ssize_t l = zsock_send(sock, bp->p, bp->left, 0); + if (l == 0) + return -ECONNRESET; if (l < 0) return -errno; bp->p += l;