curl/tests/server
Viktor Szakats 08c7c937dc
tidy-up: prefer return over exit(), fix fallouts
To avoid breaking the control flow and align to majority of code
already using `return`.

`exit()` has the side-effect of suppressing leak detection in cases.
Fix fallouts detected after switching to `return`.

- configure:
  - fix `getaddrinfo` run test to call `freeaddrinfo()` to pacify ASAN,
    and call `WSACleanup()` to deinit winsock2.
  - fix `getifaddrs` run test to call `freeifaddrs()` to pacify ASAN.
- tests/server:
  - setup `atexit(win32_cleanup)` via `win32_init()`.
  - return 2 instead of 1 on winsock2 init failures.
  - sws: goto cleanup instead of `exit()` in `http_connect()`.
    Follow-up to 02dfe71937 #7235
- tests/client/http:
  - cleanup memory to pacify ASAN in `h2-upgrade-extreme`,
    `tls-session-reuse`.
- examples:
  - block_ip: fix memory leak reported by CI.
  - http2-upload: avoid handle leaks.

Untouched `exit()` calls, made from callbacks:
- docs/examples: ephiperfifo.c, ghiper.c, hiperfifo.c
- tests/libtest: lib582.c, lib655.c, lib670.c
- tests/server: tftpd.c

Closes #16507
2025-02-28 13:11:41 +01:00
..
.checksrc checksrc: use 'banfunc' proper in more places 2025-01-13 09:10:58 +01:00
.gitignore build: drop unused getpart tool 2025-02-25 01:52:13 +01:00
base64.pl copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
CMakeLists.txt addrinfo: add curl macro to avoid redefining foreign symbols 2025-02-13 12:46:39 +01:00
disabled.c asyn-thread: use c-ares to resolve HTTPS RR 2025-01-25 23:46:14 +01:00
getpart.c build: set -O3 and tune WinCE in CI, fix getpart, vtls_scache fallouts 2025-02-26 21:23:11 +01:00
getpart.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
Makefile.am tests: fix enum/int confusion (Intel C), fix autotools CFLAGS for servers 2025-02-13 12:46:40 +01:00
Makefile.inc build: drop unused getpart tool 2025-02-25 01:52:13 +01:00
mqttd.c tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
resolve.c tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
rtspd.c tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
server_setup.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
server_sockaddr.h build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
sockfilt.c tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
socksd.c tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
sws.c tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
tftp.h tests: tidy up types in server code 2024-05-13 11:16:26 +02:00
tftpd.c tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
util.c tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
util.h tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00