Ver Fonte

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 há 3 dias atrás
pai
commit
7220bdb8b2
1 ficheiros alterados com 1 adições e 1 exclusões
  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;