[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 18/31: testcurl/https: significantly simplified test URI
From: |
gnunet |
Subject: |
[libmicrohttpd] 18/31: testcurl/https: significantly simplified test URI |
Date: |
Mon, 10 Oct 2022 13:01:03 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit f8441dac5fed1ce873728a9b71276c9321999aec
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu Oct 6 19:10:06 2022 +0300
testcurl/https: significantly simplified test URI
The set URI was overcomplicated without any practical reasons.
Fixed compiler warning on W32.
---
src/testcurl/https/tls_test_common.c | 53 +++---------------------------------
1 file changed, 4 insertions(+), 49 deletions(-)
diff --git a/src/testcurl/https/tls_test_common.c
b/src/testcurl/https/tls_test_common.c
index b44ded1e..639bccf1 100644
--- a/src/testcurl/https/tls_test_common.c
+++ b/src/testcurl/https/tls_test_common.c
@@ -321,58 +321,13 @@ gen_test_file_url (char *url,
uint16_t port)
{
unsigned int ret = 0;
- char *doc_path;
- size_t doc_path_len;
-#ifdef WINDOWS
- size_t i;
-#endif /* ! WINDOWS */
- /* setup test file path, url */
-#ifdef PATH_MAX
- doc_path_len = PATH_MAX > 4096 ? 4096 : PATH_MAX;
-#else /* ! PATH_MAX */
- doc_path_len = 4096;
-#endif /* ! PATH_MAX */
- if (NULL == (doc_path = malloc (doc_path_len)))
- {
- fprintf (stderr, MHD_E_MEM);
- return 1;
- }
- if (NULL == getcwd (doc_path, doc_path_len))
- {
- fprintf (stderr,
- "Error: failed to get working directory. %s\n",
- strerror (errno));
- free (doc_path);
- return 1;
- }
-#ifdef WINDOWS
- for (i = 0; i < doc_path_len; i++)
- {
- if (doc_path[i] == 0)
- break;
- if (doc_path[i] == '\\')
- {
- doc_path[i] = '/';
- }
- if (doc_path[i] != ':')
- continue;
- if (i == 0)
- break;
- doc_path[i] = doc_path[i - 1];
- doc_path[i - 1] = '/';
- }
-#endif
/* construct url */
- if (snprintf (url,
- url_len,
- "%s:%u%s/%s",
- "https://127.0.0.1",
- (unsigned int) port,
- doc_path,
- "urlpath") >= (long long) url_len)
+ if ((size_t) snprintf (url,
+ url_len,
+ "https://127.0.0.1:%u/urlpath",
+ (unsigned int) port) >= url_len)
ret = 1;
- free (doc_path);
return ret;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 03/31: testcurl/https: fixed compiler warnings, wrong types, (continued)
- [libmicrohttpd] 03/31: testcurl/https: fixed compiler warnings, wrong types, gnunet, 2022/10/10
- [libmicrohttpd] 06/31: testcurl/https: do not enforce TLSv1, gnunet, 2022/10/10
- [libmicrohttpd] 08/31: testcurl/https: removed usage of deprecated libcurl parameter, gnunet, 2022/10/10
- [libmicrohttpd] 10/31: test_https_get_parallel{,_threads}: removed artificial delay, gnunet, 2022/10/10
- [libmicrohttpd] 13/31: MHD_start_daemon(): minor readability improvement, gnunet, 2022/10/10
- [libmicrohttpd] 14/31: microhttpd.h: improved doxy for MHD_USE_THREAD_PER_CONNECTION, gnunet, 2022/10/10
- [libmicrohttpd] 15/31: MHD_run_wait(): improved readability, gnunet, 2022/10/10
- [libmicrohttpd] 11/31: daemon: fixed delayed notification callback in thread-per-connection mode, gnunet, 2022/10/10
- [libmicrohttpd] 16/31: daemon: small refactoring for more compact code when poll() is not supported, gnunet, 2022/10/10
- [libmicrohttpd] 17/31: MHD_poll(): removed unneeded check, gnunet, 2022/10/10
- [libmicrohttpd] 18/31: testcurl/https: significantly simplified test URI,
gnunet <=
- [libmicrohttpd] 25/31: test_https_get_parallel_threads: removed libcurl-GnuTLS requirement, gnunet, 2022/10/10
- [libmicrohttpd] 09/31: testcurl/https: enable verbose libcurl on debug builds, gnunet, 2022/10/10
- [libmicrohttpd] 21/31: test_tls_extensions: removed unused test, gnunet, 2022/10/10
- [libmicrohttpd] 29/31: https tests: updated self-signed certificate, gnunet, 2022/10/10
- [libmicrohttpd] 20/31: testcurl/https: some simplifications and clean-ups, gnunet, 2022/10/10
- [libmicrohttpd] 23/31: microhttpd.h: minor doxy fix, gnunet, 2022/10/10
- [libmicrohttpd] 24/31: digestauth.h: removed leftover in doxy, gnunet, 2022/10/10
- [libmicrohttpd] 30/31: test_tls_authentication: fixed to really test TLS authentication, gnunet, 2022/10/10
- [libmicrohttpd] 19/31: testcurl/https: added proper check for snprintf() result, gnunet, 2022/10/10
- [libmicrohttpd] 22/31: test_https_session_info: removed hardcoded TLS version, gnunet, 2022/10/10