aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-09-17 00:00:52 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-09-17 00:31:23 +0200
commit126105fa4f7fb8ea5d6b589ddf9f0a109366d638 (patch)
tree4f3eaae0e1ece43dd07ea68c2d752d8431ced6e3
parente2f3fc2e79fd38f86ea788c8881cb043c4f6e178 (diff)
downloadxK-126105fa4f7fb8ea5d6b589ddf9f0a109366d638.tar.gz
xK-126105fa4f7fb8ea5d6b589ddf9f0a109366d638.tar.xz
xK-126105fa4f7fb8ea5d6b589ddf9f0a109366d638.zip
xC: don't abort on accept() failure
Just disable the relay.
-rw-r--r--xC.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/xC.c b/xC.c
index 8baf71d..3f64804 100644
--- a/xC.c
+++ b/xC.c
@@ -2910,12 +2910,16 @@ relay_try_fetch_client (struct app_context *ctx, int listen_fd)
if (errno == EINTR)
return true;
+ // TODO: Try to make sure these find their way to the global buffer.
if (accept_error_is_transient (errno))
+ {
print_warning ("%s: %s", "accept", strerror (errno));
- else
- // TODO: Rather dispose of the listening socket.
- print_fatal ("%s: %s", "accept", strerror (errno));
- return true;
+ return true;
+ }
+
+ print_error ("%s: %s", "accept", strerror (errno));
+ app_context_relay_stop (ctx);
+ return false;
}
hard_assert (peer_len <= sizeof peer);