minio-cpp icon indicating copy to clipboard operation
minio-cpp copied to clipboard

If the URL is invalid, it will wait indefinitely

Open sxcong opened this issue 9 months ago • 0 comments

http.cc line 447: if (select(maxfd + 1, &fdread, &fdwrite, &fdexcep, nullptr) < 0)

"nullptr " Should use timeout:

struct timeval timeout; timeout.tv_sec = xxx; timeout.tv_usec = xxx; select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

and, You should add connection timeout and request timeout: request.setOpt(new curlpp::Options::ConnectTimeout(2000)); request.setOpt(new curlpp::Options::Timeout(5));

The code is too rough.

sxcong avatar Feb 11 '25 01:02 sxcong