commit 02af598a814e7204f8b2ba7f90976ef35e43f174
parent 16ac89f3beb982dab4f1552ffb94e637b45ca324
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Wed, 18 Aug 2021 10:13:36 +0300
test_get_close_keep_alive: minor reporting improvment
Diffstat:
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/testcurl/test_get_close_keep_alive.c b/src/testcurl/test_get_close_keep_alive.c
@@ -669,8 +669,8 @@ doCurlQueryInThread (struct MHD_Daemon *d,
if (0 != getMhdActiveConnections (d))
{
print_test_params (add_hdr_close, add_hdr_k_alive);
- fprintf (stderr,
- "MHD still has active connection after response has been sent.\n");
+ fprintf (stderr, "MHD still has active connection "
+ "after response has been sent.\n");
p->queryError |= 2;
}
}
@@ -694,13 +694,22 @@ doCurlQueryInThread (struct MHD_Daemon *d,
if (use_external_poll)
{ /* The number of MHD connection can be used only with external poll.
* otherwise it creates a race condition. */
- if (1 != getMhdActiveConnections (d))
+ unsigned int num_conn = getMhdActiveConnections (d);
+ if (0 == num_conn)
{
print_test_params (add_hdr_close, add_hdr_k_alive);
- fprintf (stderr,
- "MHD has no active connection after response has been sent.\n");
+ fprintf (stderr, "MHD has no active connection "
+ "after response has been sent.\n");
p->queryError |= 2;
}
+ else if (1 != num_conn)
+ {
+ print_test_params (add_hdr_close, add_hdr_k_alive);
+ fprintf (stderr, "MHD has wrong number of active connection (%u) "
+ "after response has been sent. Line: %d\n", num_conn,
+ __LINE__);
+ _exit (23);
+ }
}
}
curl_easy_cleanup (c);