-
Bug
-
Resolution: Won't Do
-
Minor
-
rhel-8.6.0, rhel-9.3.0
-
None
-
None
-
Low
-
EasyFix
-
285f2e7b87ac66e405066747495a70f666915a24
-
sst_cs_plumbers
-
ssg_core_services
-
3
-
False
-
-
None
-
Red Hat Enterprise Linux
-
None
-
None
-
None
-
All
-
None
What were you trying to do that didn't work?
Calling:
libcurl_easy_getinfo(CURLE*, CURLINFO_LOCAL_PORT, long*)
after reusing the easy handle leads to the port being set to -1 instead of the last
used port.
Please provide the package NVR for which bug is seen:
libcurl-devel-7.76.1-26.el9_3.2.x86_64
How reproducible:
Always
Steps to reproduce
- Simple C++ program
#include <curl/curl.h>
#include <iostream>
#include <unistd.h>
#include <stdlib.h>
int main()
{ curl_global_init(CURL_GLOBAL_ALL); CURL* easyHandle = curl_easy_init(); curl_easy_setopt(easyHandle, CURLOPT_URL, "http://google.com"); long port; curl_easy_perform(easyHandle); curl_easy_getinfo(easyHandle, CURLINFO_LOCAL_PORT, &port); std::cout << "Local port: " << port << std::endl; curl_easy_perform(easyHandle); curl_easy_getinfo(easyHandle, CURLINFO_LOCAL_PORT, &port); std::cout << "Local port: " << port << std::endl; return 0; }2. Compile
g++ -lcurl main.cpp
3. Run program
Expected results
Local port: 42732
Local port: <some_valid_port_number>
Actual results
Local port: 42732
Local port: -1
NOTE:
This issue is fixed in
https://github.com/jbrownsw/curl/commit/285f2e7b87ac66e405066747495a70f666915a24