Jelajahi Sumber

Pass the read state to curl by address in the Expect test

CURLOPT_READDATA takes a pointer, but ServerClosesConnection passed
the read_data struct itself through curl_easy_setopt()'s varargs, so
the read callback never got its state and never produced a body.
yhirose 3 hari lalu
induk
melakukan
7220bdb8b2
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      test/test.cc

+ 1 - 1
test/test.cc

@@ -21202,7 +21202,7 @@ TEST(Expect100ContinueTest, ServerClosesConnection) {
       d->read_size += size * nmemb;
       return size * nmemb;
     };
-    curl_easy_setopt(curl.get(), CURLOPT_READDATA, data);
+    curl_easy_setopt(curl.get(), CURLOPT_READDATA, &data);
     curl_easy_setopt(curl.get(), CURLOPT_READFUNCTION, read_callback);
 
     std::vector<char> buffer;