summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-05-10 19:30:30 +0200
committerLeah Neukirchen <leah@vuxu.org>2020-05-10 19:31:52 +0200
commitce0727e85233aaeddfcc5b72c818472fc55bf102 (patch)
tree1b06dafc34f01d03adec8b9ba884045b290a70f4
parent418853dc10e8a9de715155f0820e44e7d66ae164 (diff)
downloadhittpd-ce0727e85233aaeddfcc5b72c818472fc55bf102.tar.gz
hittpd-ce0727e85233aaeddfcc5b72c818472fc55bf102.tar.xz
hittpd-ce0727e85233aaeddfcc5b72c818472fc55bf102.zip
ignore peer address when accepting
-rw-r--r--hittpd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/hittpd.c b/hittpd.c
index bbc94ac..d6c3fa1 100644
--- a/hittpd.c
+++ b/hittpd.c
@@ -1048,11 +1048,9 @@ main(int argc, char *argv[])
 			/* new client connection */
 			for (i = 1; i < MAX_CLIENTS; i++)
 				if (client[i].fd < 0) {
-					struct sockaddr_in6 cliaddr;
-					socklen_t clilen = sizeof cliaddr;
-					int connfd = accept(listenfd,
-					    (struct sockaddr *)&cliaddr, &clilen);
-					accept_client(i, connfd);
+					int connfd = accept(listenfd, 0, 0);
+					if (connfd >= 0)
+						accept_client(i, connfd);
 					break;
 				}
 			if (i == MAX_CLIENTS)