libmicrohttpd

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

commit 07829e8544c893e4b278eaf9b091d3f6d9b3eaba
parent 916886cdf6b64cd94f89de45c886fae5ec80bf65
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Sat, 23 Oct 2021 16:41:33 +0300

test_add_conn: used the better way to mute compiler and analyzer warnings

Diffstat:
Msrc/testcurl/test_add_conn.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/testcurl/test_add_conn.c b/src/testcurl/test_add_conn.c @@ -1053,12 +1053,11 @@ testStopRace (enum testMhdPollType pollType) MHD_socket fd2; struct addConnParam aParam; int ret = 0; /* Return value of the test */ - const int c_no_listen = no_listen; /* Local const value to mute analyzer */ d = startTestMhdDaemon (testMhdThreadInternal, pollType, &d_port); - if (! c_no_listen) + if (! no_listen) { fd1 = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); if (MHD_INVALID_SOCKET == fd1) @@ -1071,6 +1070,8 @@ testStopRace (enum testMhdPollType pollType) if (connect (fd1, (struct sockaddr *) (&sin), sizeof(sin)) < 0) externalErrorExitDesc ("socket() failed"); } + else + fd1 = MHD_INVALID_SOCKET; aParam.d = d; aParam.lstn_sk = createListeningSocket (&a_port); /* Sets a_port */ @@ -1092,7 +1093,7 @@ testStopRace (enum testMhdPollType pollType) MHD_stop_daemon (d); - if (! c_no_listen) + if (MHD_INVALID_SOCKET != fd1) (void) MHD_socket_close_ (fd1); (void) MHD_socket_close_ (aParam.lstn_sk); (void) MHD_socket_close_ (fd2);