minio-cpp
minio-cpp copied to clipboard
If the URL is invalid, it will wait indefinitely
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.