From 9cbeb8fc59a31fd9c2324e046f34aaf72c02bc77 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 27 Mar 2022 10:48:33 -0700 Subject: [PATCH] ... --- src/net/send.c | 7 +++++++ test/unit/Makefile.am | 4 +++- test/unit/net.tests.c | 13 +++++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/net/send.c b/src/net/send.c index f73c23c..e206987 100644 --- a/src/net/send.c +++ b/src/net/send.c @@ -4,6 +4,13 @@ int net_send(int sock, struct peer *info, void *p, size_t size) { ssize_t i; i = send(sock,p,size,0); + if(-1==i) { + if(!((errno==EAGAIN)||(errno==EWOULDBLOCK))) { + perror("send"); + return -1; + } + } + if(i