libmicrohttpd

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

commit 58274f943df237ee608da8849969739c365dd664
parent 8851d88e40a33bb942165c45d4e9d439038106a9
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Thu,  6 Apr 2017 22:10:44 +0300

Used "127.0.0.1" instead of "localhost" in all tests to avoid accidental try by IPv6

Diffstat:
MChangeLog | 5+++++
Msrc/microhttpd/test_upgrade.c | 4++--
Msrc/testzzuf/test_get.c | 6+++---
Msrc/testzzuf/test_get_chunked.c | 6+++---
Msrc/testzzuf/test_long_header.c | 6+++---
Msrc/testzzuf/test_post.c | 6+++---
Msrc/testzzuf/test_post_form.c | 6+++---
Msrc/testzzuf/test_put.c | 6+++---
Msrc/testzzuf/test_put_chunked.c | 6+++---
Msrc/testzzuf/test_put_large.c | 6+++---
10 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,8 @@ +Thu Apr 06 22:14:22 MSK 2017 + Added warning for hypothetical extra large timeout. + Fixed incorrect timeout calculation under extra rare conditions. + Fixed accidental usage of IPv6 in testsuite in specific conditions. -EG + Wed Apr 05 14:14:22 MSK 2017 Updated autoinit_funcs.h to latest upstream version with proper support of Oracle/Sun compiler. -EG diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c @@ -117,14 +117,14 @@ gnutlscli_connect (int *sock, "--insecure", "-p", destination, - "localhost", + "127.0.0.1", (char *) NULL); } else if (TLS_CLI_OPENSSL == use_tls_tool) { snprintf (destination, sizeof(destination), - "localhost:%u", + "127.0.0.1:%u", (unsigned int) port); execlp ("openssl", "openssl", diff --git a/src/testzzuf/test_get.c b/src/testzzuf/test_get.c @@ -113,7 +113,7 @@ testInternalGet () { fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); @@ -157,7 +157,7 @@ testMultithreadedGet () { fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); @@ -218,7 +218,7 @@ testExternalGet () { fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); diff --git a/src/testzzuf/test_get_chunked.c b/src/testzzuf/test_get_chunked.c @@ -139,7 +139,7 @@ testInternalGet () { fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); @@ -180,7 +180,7 @@ testMultithreadedGet () { fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); @@ -238,7 +238,7 @@ testExternalGet () { fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); diff --git a/src/testzzuf/test_long_header.c b/src/testzzuf/test_long_header.c @@ -123,8 +123,8 @@ testLongUrlGet () url = malloc (VERY_LONG); memset (url, 'a', VERY_LONG); url[VERY_LONG - 1] = '\0'; - memcpy (url, "http://localhost:11081/", - strlen ("http://localhost:11081/")); + memcpy (url, "http://127.0.0.1:11081/", + strlen ("http://127.0.0.1:11081/")); curl_easy_setopt (c, CURLOPT_URL, url); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); @@ -188,7 +188,7 @@ testLongHeaderGet () header = curl_slist_append (header, url); curl_easy_setopt (c, CURLOPT_HTTPHEADER, header); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); diff --git a/src/testzzuf/test_post.c b/src/testzzuf/test_post.c @@ -169,7 +169,7 @@ testInternalPost () fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA); @@ -221,7 +221,7 @@ testMultithreadedPost () fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA); @@ -291,7 +291,7 @@ testExternalPost () c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:1082/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:1082/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_POSTFIELDS, POST_DATA); diff --git a/src/testzzuf/test_post_form.c b/src/testzzuf/test_post_form.c @@ -187,7 +187,7 @@ testInternalPost () { fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); pd = make_form (); @@ -238,7 +238,7 @@ testMultithreadedPost () { fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); pd = make_form (); @@ -306,7 +306,7 @@ testExternalPost () fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:1082/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:1082/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); pd = make_form (); diff --git a/src/testzzuf/test_put.c b/src/testzzuf/test_put.c @@ -138,7 +138,7 @@ testInternalPut () { fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer); @@ -189,7 +189,7 @@ testMultithreadedPut () { fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer); @@ -258,7 +258,7 @@ testExternalPut () fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer); diff --git a/src/testzzuf/test_put_chunked.c b/src/testzzuf/test_put_chunked.c @@ -144,7 +144,7 @@ testInternalPut () { fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11080/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11080/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer); @@ -191,7 +191,7 @@ testMultithreadedPut () if (d == NULL) return 16; c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer); @@ -270,7 +270,7 @@ testExternalPut () { fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11082/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11082/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer); diff --git a/src/testzzuf/test_put_large.c b/src/testzzuf/test_put_large.c @@ -153,7 +153,7 @@ testInternalPut () fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer); @@ -205,7 +205,7 @@ testMultithreadedPut () fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer); @@ -276,7 +276,7 @@ testExternalPut () fprintf (stderr, "."); c = curl_easy_init (); - curl_easy_setopt (c, CURLOPT_URL, "http://localhost:11081/hello_world"); + curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1:11081/hello_world"); curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); curl_easy_setopt (c, CURLOPT_READFUNCTION, &putBuffer);