aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2023-12-08 16:40:31 +0200
committerSyndamia <kamen@syndamia.com>2023-12-08 16:40:31 +0200
commit699cef84b11d43ac23b6bc7b1b605aa8c53f35b6 (patch)
treeb52f0f16e7c338c6dd40bafef34a68809431c80c
parentf26e610c2f0bdb07fce3f7a100b3ef6159c2ffe7 (diff)
downloadpico-web-699cef84b11d43ac23b6bc7b1b605aa8c53f35b6.tar
pico-web-699cef84b11d43ac23b6bc7b1b605aa8c53f35b6.tar.gz
pico-web-699cef84b11d43ac23b6bc7b1b605aa8c53f35b6.zip
[server] Don't continue on accept() error
-rw-r--r--server.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/server.c b/server.c
index 6862961..02c9f5a 100644
--- a/server.c
+++ b/server.c
@@ -112,6 +112,7 @@ int main(int argc, char* argv[]) {
/* If so, accept the connection and pass execution to the "main" logic */
fd_client = accept(fd_socket, (struct sockaddr*)&sa_client, &sa_client_size);
herrc(fd_client, "accept");
+ if (fd_client < 0) continue;
char* strAddr = inet_ntoa(sa_client.sin_addr);
count++;