aboutsummaryrefslogtreecommitdiff
path: root/general_network.h
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-08-12 23:45:35 -0400
committerTest_User <hax@andrewyu.org>2024-08-12 23:45:35 -0400
commit4b211d19da3f6a35e87fcb350527d9a992449b41 (patch)
tree275859ca4359e53353e9ce2f48c6ee9f87aaa802 /general_network.h
parent770cb2f15a96693cce0ba56acaf8dcee6b7339a1 (diff)
downloadhaxircd-4b211d19da3f6a35e87fcb350527d9a992449b41.tar.gz
haxircd-4b211d19da3f6a35e87fcb350527d9a992449b41.zip
Improve accept retrying conditions
Diffstat (limited to 'general_network.h')
-rw-r--r--general_network.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/general_network.h b/general_network.h
index cfb61fb..9f35f64 100644
--- a/general_network.h
+++ b/general_network.h
@@ -37,6 +37,12 @@
#include "protocol_numbers.h"
#include "table.h"
+#ifdef ENONET
+#define RETRY_ACCEPT (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK || errno == ENETDOWN || errno == EPROTO || errno == ENOPROTOOPT || errno == EHOSTDOWN || errno == ENONET || errno == EHOSTUNREACH || errno == EOPNOTSUPP || errno == ENETUNREACH)
+#else
+#define RETRY_ACCEPT (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK || errno == ENETDOWN || errno == EPROTO || errno == ENOPROTOOPT || errno == EHOSTDOWN || errno == EHOSTUNREACH || errno == EOPNOTSUPP || errno == ENETUNREACH)
+#endif
+
struct network {
int (*send)(void *handle, struct string msg);
size_t (*recv)(void *handle, char *data, size_t len, char *err);