check HTTP status after ping, and use https by default

git-svn-id: svn://localhost/ardour2/branches/3.0@14191 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2013-03-08 18:04:59 +00:00
parent cfacfe025b
commit ed5ff77313

View file

@ -92,9 +92,9 @@ _pingback (void *arg)
string url;
#ifdef __APPLE__
url = "http://community.ardour.org/pingback/osx/";
url = "https://community.ardour.org/pingback/osx/";
#else
url = "http://community.ardour.org/pingback/linux/";
url = "https://community.ardour.org/pingback/linux/";
#endif
char* v = curl_easy_escape (c, cm->version.c_str(), cm->version.length());
@ -130,6 +130,14 @@ _pingback (void *arg)
return_str = "";
if (curl_easy_perform (c) == 0) {
int http_status;
curl_easy_getinfo (c, CURLINFO_RESPONSE_CODE, &http_status);
if (http_status != 200) {
std::cerr << "Bad HTTP status" << std::endl;
return 0;
}
if ( return_str.length() > 140 ) { // like a tweet :)
std::cerr << "Announcement string is too long (probably behind a proxy)." << std::endl;