ソースを参照

test_get_close_keep_alive: minor reporting improvment

Evgeny Grin (Karlson2k) 4 年 前
コミット
02af598a81
1 ファイル変更14 行追加5 行削除
  1. 14 5
      src/testcurl/test_get_close_keep_alive.c

+ 14 - 5
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);