aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2023-05-25 13:22:16 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2023-06-01 13:00:15 +0300
commit79c57fad8d5d225573fa1277f72211e511a4564a (patch)
tree6d3dd42a48b957fcfa2df58f8b7d1d24d5b12358
parentba5538e246d2835c0dde50f7995c87f57e2ebbb4 (diff)
downloadlibmicrohttpd-79c57fad8d5d225573fa1277f72211e511a4564a.tar.gz
libmicrohttpd-79c57fad8d5d225573fa1277f72211e511a4564a.zip
daemon.c: redesigned code for clarity and formatting
No functional change
-rw-r--r--src/microhttpd/daemon.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 5e9be378..b14e68f3 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -4548,13 +4548,10 @@ MHD_select (struct MHD_Daemon *daemon,
4548 &maxsock, 4548 &maxsock,
4549 FD_SETSIZE)) ) 4549 FD_SETSIZE)) )
4550 { 4550 {
4551#if ! defined(MHD_WINSOCK_SOCKETS) 4551 bool retry_succeed;
4552#ifdef HAVE_MESSAGES 4552
4553 MHD_DLOG (daemon, _ ("Could not add control inter-thread " \ 4553 retry_succeed = false;
4554 "communication channel FD to fdset.\n")); 4554#if defined(MHD_WINSOCK_SOCKETS)
4555#endif
4556 err_state = MHD_YES;
4557#else /* MHD_WINSOCK_SOCKETS */
4558 /* fdset limit reached, new connections 4555 /* fdset limit reached, new connections
4559 cannot be handled. Remove listen socket FD 4556 cannot be handled. Remove listen socket FD
4560 from fdset and retry to add ITC FD. */ 4557 from fdset and retry to add ITC FD. */
@@ -4563,19 +4560,22 @@ MHD_select (struct MHD_Daemon *daemon,
4563 { 4560 {
4564 FD_CLR (ls, 4561 FD_CLR (ls,
4565 &rs); 4562 &rs);
4566 if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc), 4563 if (MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
4567 &rs, 4564 &rs,
4568 &maxsock, 4565 &maxsock,
4569 FD_SETSIZE)) 4566 FD_SETSIZE))
4570 { 4567 retry_succeed = true;
4568 }
4569#endif /* MHD_WINSOCK_SOCKETS */
4570
4571 if (! retry_succeed)
4572 {
4571#ifdef HAVE_MESSAGES 4573#ifdef HAVE_MESSAGES
4572 MHD_DLOG (daemon, _ ("Could not add control inter-thread " \ 4574 MHD_DLOG (daemon, _ ("Could not add control inter-thread " \
4573 "communication channel FD to fdset.\n")); 4575 "communication channel FD to fdset.\n"));
4574#endif 4576#endif
4575 err_state = MHD_YES; 4577 err_state = MHD_YES;
4576 }
4577 } 4578 }
4578#endif /* MHD_WINSOCK_SOCKETS */
4579 } 4579 }
4580 /* Stop listening if we are at the configured connection limit */ 4580 /* Stop listening if we are at the configured connection limit */
4581 /* If we're at the connection limit, no point in really 4581 /* If we're at the connection limit, no point in really