Skip to content

Commit

Permalink
Commented check_curl_h2_upgrade: we need a test_helpers framework...
Browse files Browse the repository at this point in the history
  • Loading branch information
maru committed May 21, 2019
1 parent 3f1b6e9 commit 24b997a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
20 changes: 10 additions & 10 deletions src/microhttpd/test_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,15 @@ set_http_version(const char *prog_name, int allow_1_0)
* Return 1 if the connection performed the upgrade,
* otherwise, return 0.
*/
int check_curl_h2_upgrade (CURL *c, int http_version)
{
if (CURL_HTTP_VERSION_2_0 != http_version)
return -1;
long http_version_res;
#ifdef HAVE_LIBCURL
curl_easy_getinfo(c, CURLINFO_HTTP_VERSION, &http_version_res);
#endif /* HAVE_LIBCURL */
return http_version_res == http_version;
}
// int check_curl_h2_upgrade (CURL *c, int http_version)
// {
// if (CURL_HTTP_VERSION_2_0 != http_version)
// return -1;
// long http_version_res;
// #ifdef HAVE_LIBCURL
// curl_easy_getinfo (c, CURLINFO_HTTP_VERSION, &http_version_res);
// #endif /* HAVE_LIBCURL */
// return http_version_res == http_version;
// }

#endif /* TEST_HELPERS_H_ */
24 changes: 12 additions & 12 deletions src/testcurl/test_post.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ testInternalPost ()
if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world")))
return 8;

if (check_curl_h2_upgrade (c, http_version) == 0)
return 1L << 19;
// if (check_curl_h2_upgrade (c, http_version) == 0)
// return 1L << 19;

return 0;
}
Expand Down Expand Up @@ -304,8 +304,8 @@ testMultithreadedPost ()
if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world")))
return 128;

if (check_curl_h2_upgrade (c, http_version) == 0)
return 1L << 19;
// if (check_curl_h2_upgrade (c, http_version) == 0)
// return 1L << 19;

return 0;
}
Expand Down Expand Up @@ -379,8 +379,8 @@ testMultithreadedPoolPost ()
if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world")))
return 128;

if (check_curl_h2_upgrade (c, http_version) == 0)
return 1L << 19;
// if (check_curl_h2_upgrade (c, http_version) == 0)
// return 1L << 19;

return 0;
}
Expand Down Expand Up @@ -408,7 +408,7 @@ testExternalPost ()
time_t start;
struct timeval tv;
int port;
int h2_upgrade_not_done = 0;
// int h2_upgrade_not_done = 0;

if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
port = 0;
Expand Down Expand Up @@ -522,7 +522,7 @@ testExternalPost ()
"curl_multi_perform",
__FILE__,
__LINE__, curl_easy_strerror (msg->data.result));
h2_upgrade_not_done = check_curl_h2_upgrade (c, http_version) == 0;
// h2_upgrade_not_done = check_curl_h2_upgrade (c, http_version) == 0;
curl_multi_remove_handle (multi, c);
curl_multi_cleanup (multi);
curl_easy_cleanup (c);
Expand All @@ -543,8 +543,8 @@ testExternalPost ()
if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world")))
return 16384;

if (h2_upgrade_not_done)
return 1L << 19;
// if (h2_upgrade_not_done)
// return 1L << 19;

return 0;
}
Expand Down Expand Up @@ -753,8 +753,8 @@ testMultithreadedPostCancelPart(int flags)
result = 262144;

/* HTTP/2 Upgrade should not happen */
if (check_curl_h2_upgrade (c, http_version) == 1)
result = 1L << 19;
// if (check_curl_h2_upgrade (c, http_version) == 1)
// result = 1L << 19;

curl_easy_cleanup (c);
MHD_stop_daemon (d);
Expand Down

0 comments on commit 24b997a

Please sign in to comment.