Quellcode durchsuchen

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

Evgeny Grin (Karlson2k) vor 8 Jahren
Ursprung
Commit
58274f943d

+ 5 - 0
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

+ 2 - 2
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",

+ 3 - 3
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);

+ 3 - 3
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);

+ 3 - 3
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);

+ 3 - 3
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);

+ 3 - 3
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 ();

+ 3 - 3
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);

+ 3 - 3
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);

+ 3 - 3
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);