[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 14/20: test_digestauth2: reuse the same connection for t
From: |
gnunet |
Subject: |
[libmicrohttpd] 14/20: test_digestauth2: reuse the same connection for the second request |
Date: |
Mon, 15 Aug 2022 20:38:40 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 8a210d2885a5cf8c072806cc64d9b46f1d9c8e05
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon Aug 15 17:30:44 2022 +0300
test_digestauth2: reuse the same connection for the second request
---
src/testcurl/test_digestauth2.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/src/testcurl/test_digestauth2.c b/src/testcurl/test_digestauth2.c
index fa418f69..ade4d2a5 100644
--- a/src/testcurl/test_digestauth2.c
+++ b/src/testcurl/test_digestauth2.c
@@ -1129,7 +1129,7 @@ setupCURL (void *cbc, unsigned int port)
static CURLcode
-performQueryExternal (struct MHD_Daemon *d, CURL *c)
+performQueryExternal (struct MHD_Daemon *d, CURL *c, CURLM **multi_reuse)
{
CURLM *multi;
time_t start;
@@ -1137,10 +1137,15 @@ performQueryExternal (struct MHD_Daemon *d, CURL *c)
CURLcode ret;
ret = CURLE_FAILED_INIT; /* will be replaced with real result */
- multi = NULL;
- multi = curl_multi_init ();
- if (multi == NULL)
- libcurlErrorExitDesc ("curl_multi_init() failed");
+ if (NULL != *multi_reuse)
+ multi = *multi_reuse;
+ else
+ {
+ multi = curl_multi_init ();
+ if (multi == NULL)
+ libcurlErrorExitDesc ("curl_multi_init() failed");
+ *multi_reuse = multi;
+ }
if (CURLM_OK != curl_multi_add_handle (multi, c))
libcurlErrorExitDesc ("curl_multi_add_handle() failed");
@@ -1185,7 +1190,6 @@ performQueryExternal (struct MHD_Daemon *d, CURL *c)
externalErrorExit ();
}
curl_multi_remove_handle (multi, c);
- curl_multi_cleanup (multi);
multi = NULL;
}
else
@@ -1291,6 +1295,7 @@ testDigestAuth (void)
struct req_track rq_tr;
char buf[2048];
CURL *c;
+ CURLM *multi_reuse;
int failed = 0;
if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
@@ -1348,8 +1353,9 @@ testDigestAuth (void)
cbc.pos = 0;
memset (cbc.buf, 0, cbc.size);
c = setupCURL (&cbc, (unsigned int) port);
+ multi_reuse = NULL;
/* First request */
- if (check_result (performQueryExternal (d, c), c, &cbc))
+ if (check_result (performQueryExternal (d, c, &multi_reuse), c, &cbc))
{
if (verbose)
printf ("Got expected response.\n");
@@ -1363,7 +1369,7 @@ testDigestAuth (void)
rq_tr.req_num = 0;
/* Second request */
setCURL_rq_path (c, port, ++rq_tr.uri_num);
- if (check_result (performQueryExternal (d, c), c, &cbc))
+ if (check_result (performQueryExternal (d, c, &multi_reuse), c, &cbc))
{
if (verbose)
printf ("Got expected response.\n");
@@ -1374,6 +1380,8 @@ testDigestAuth (void)
failed = 1;
}
curl_easy_cleanup (c);
+ if (NULL != multi_reuse)
+ curl_multi_cleanup (multi_reuse);
MHD_stop_daemon (d);
return failed ? 1 : 0;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 03/20: daemon.c: cosmetics, (continued)
- [libmicrohttpd] 03/20: daemon.c: cosmetics, gnunet, 2022/08/15
- [libmicrohttpd] 07/20: digestauth: do not use "algorithm" in response header in RFC2069 mode, gnunet, 2022/08/15
- [libmicrohttpd] 11/20: Added MHD_OPTION_DIGEST_AUTH_NONCE_BIND_TYPE to control how to generate and check nonces for Digest Auth, gnunet, 2022/08/15
- [libmicrohttpd] 10/20: daemon.c: fixed and simplified sockaddr alignment handling, gnunet, 2022/08/15
- [libmicrohttpd] 02/20: microhttpd: minor doxy improvement, gnunet, 2022/08/15
- [libmicrohttpd] 17/20: digestauth: minor comment correction, gnunet, 2022/08/15
- [libmicrohttpd] 15/20: test_digestauth2: added third request with new connection, gnunet, 2022/08/15
- [libmicrohttpd] 19/20: digestauth: updated the method of nonce generation in default mode, gnunet, 2022/08/15
- [libmicrohttpd] 20/20: calculate_nonce(): added comments, minor code corrections, gnunet, 2022/08/15
- [libmicrohttpd] 09/20: mhd_str: added function for bin to hex without zero-termination, gnunet, 2022/08/15
- [libmicrohttpd] 14/20: test_digestauth2: reuse the same connection for the second request,
gnunet <=
- [libmicrohttpd] 13/20: test_digestauth2: added testing of nonce bind options, gnunet, 2022/08/15