maru / libmicrohttpd-http2

HTTP/2 support for libmicrohttpd
https://http2.s106.net/
Other
22 stars 6 forks source link

test_get_sendfile_http2 and test_get_sendfile_http2_direct use same temp file #55

Closed maru closed 5 years ago

maru commented 5 years ago

Reported by @rockdaboot : Another issue, one of the test_get_sendfile_http2/test_get_sendfile_http2_direct tests fails here. Reason was that both create and delete the same temp file. If run in parallel, there was a race condition. Fix was to use diferent file names:

diff --git a/src/testcurl/test_get_sendfile.c b/src/testcurl/test_get_sendfile.c
index 0cb2e480..9607caf9 100644
--- a/src/testcurl/test_get_sendfile.c
+++ b/src/testcurl/test_get_sendfile.c
@@ -573,8 +573,7 @@ main (int argc, char *const *argv)
             "%s/%s%s",
             tmp,
             "test-mhd-sendfile",
-            (http_version == CURL_HTTP_VERSION_1_1)  ? "11" :
-              (http_version == CURL_HTTP_VERSION_1_0)  ? "" : "http2");
+            use_http_version);
   f = fopen (sourcefile, "w");
   if (NULL == f)
     {
maru commented 5 years ago

Patch applied in 316af7c06537e524c6ef02bc1d5f59b39af7d1d1