From ed5ff77313c2173fa96547d58aacc672092ecd5b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 8 Mar 2013 18:04:59 +0000 Subject: 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 --- gtk2_ardour/pingback.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'gtk2_ardour/pingback.cc') diff --git a/gtk2_ardour/pingback.cc b/gtk2_ardour/pingback.cc index 6fd34b14e6..e986b8e260 100644 --- a/gtk2_ardour/pingback.cc +++ b/gtk2_ardour/pingback.cc @@ -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; -- cgit v1.2.3