Just setting the CURLcode variable names all to "result" for beauty.
CURLOPT_TIMEOUT added for CDM Version & Vatsim Data
Fixed CURL_URL_MALFORMAT on six occursions. CURL expects a char*, gets a std::string - Actually fixes all CURL problems for me
CURL response-check only looked for 404 or CURLE_OPERATION_TIMEDOUT. It didn't catch the above mentioned MALFORMAT or one, that occured for me: COULDNT_RESOLVEHOST. Now it catches all of them:
-- (CURLEOK (0): The request was successful.)
-- CURLE_UNSUPPORTED_PROTOCOL (1): The URL you provided uses an unsupported protocol.
-- CURLE_FAILED_INIT (2): libcurl failed to initialize.
-- CURLE_URL_MALFORMAT (3): The URL is not properly formatted.
-- CURLE_COULDNT_RESOLVE_PROXY (5): Could not resolve the proxy hostname.
-- CURLE_COULDNT_RESOLVE_HOST (6): Could not resolve the remote hostname.
-- CURLE_COULDNT_CONNECT (7): Could not connect to the remote host.
-- CURLE_OPERATION_TIMEDOUT (28): The request timed out.
-- CURLE_SSL_CONNECT_ERROR (35): A problem occurred during SSL connection.
Fixed crash, if object curl doesn't initialize for any reason
You might want to consider sharing the fail reason with the user
sendMessage("UNABLE TO LOAD CAD URL (" + string(curl_easy_strerror(result)) + ")");
You might want to consider sharing the fail reason with the user
or something like that