libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 2bb7c9f2e6352e6e2345b8768b3b9f3b9d582bc9
parent f89621ff44ded2c93228f18b9a56865eda0e3562
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Wed, 17 May 2023 11:15:02 +0300

test_client_put_stop: fixed test on Darwin

Diffstat:
Msrc/microhttpd/test_client_put_stop.c | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/microhttpd/test_client_put_stop.c b/src/microhttpd/test_client_put_stop.c @@ -310,8 +310,14 @@ test_global_init (void) mib[1] = PF_INET; mib[2] = IPPROTO_ICMP; mib[3] = ICMPCTL_ICMPLIM; - if ((0 != sysctl (mib, 4, &limit, &limit_size, NULL, 0)) || - (sizeof(limit) != limit_size) ) + if (0 != sysctl (mib, 4, &limit, &limit_size, NULL, 0)) + { + if (ENOENT == errno) + limit = 0; /* No such parameter (Darwin) */ + else + externalErrorExitDesc ("Cannot get RST rate limit value"); + } + else if (sizeof(limit) != limit_size) externalErrorExitDesc ("Cannot get RST rate limit value"); if (limit > 0) {