Skip to content

Commit 9ddb81e

Browse files
committed
Guard legacy Curl socket conversion
Only convert CURLINFO_LASTSOCKET output after curl_easy_getinfo succeeds, matching the modern socket path and avoiding use of an invalid result. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: aefd8d4a-8755-4853-8e6b-267cce60e3a9
1 parent 5b6e163 commit 9ddb81e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎lib/http/HttpClient_Curl.hpp‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ class CurlHttpOperation {
279279
#else
280280
long lastSocket = -1;
281281
res = curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, &lastSocket);
282-
sockextr = static_cast<curl_socket_t>(lastSocket);
282+
if (res == CURLE_OK)
283+
{
284+
sockextr = static_cast<curl_socket_t>(lastSocket);
285+
}
283286
#endif
284287

285288
if(CURLE_OK != res)

0 commit comments

Comments
 (0)