/*
- Copyright (C) 2012 Paul Davis
+ Copyright (C) 2012 Paul Davis
Inspired by code from Ben Loftis @ Harrison Consoles
This program is free software; you can redistribute it and/or modify
*/
#include <string>
-#include <iostream>
-#include <fstream>
#include <cstring>
#ifdef PLATFORM_WINDOWS
#include <curl/curl.h>
-#include <pbd/gstdio_compat.h>
+#include "pbd/gstdio_compat.h"
#include <glibmm/miscutils.h>
#include "pbd/compose.h"
#include "ardour/rc_configuration.h"
#include "pingback.h"
+#include "utils.h"
using std::string;
using namespace ARDOUR;
curl_global_init (CURL_GLOBAL_NOTHING);
c = curl_easy_init ();
-
- curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, curl_write_data);
- curl_easy_setopt (c, CURLOPT_WRITEDATA, &return_str);
+
+ curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, curl_write_data);
+ curl_easy_setopt (c, CURLOPT_WRITEDATA, &return_str);
char errbuf[CURL_ERROR_SIZE];
- curl_easy_setopt (c, CURLOPT_ERRORBUFFER, errbuf);
+ curl_easy_setopt (c, CURLOPT_ERRORBUFFER, errbuf);
string url;
return_str = "";
if (curl_easy_perform (c) == 0) {
- long http_status;
+ long http_status;
curl_easy_getinfo (c, CURLINFO_RESPONSE_CODE, &http_status);
std::cerr << "Announcement string is too long (probably behind a proxy)." << std::endl;
} else {
std::cerr << "Announcement is: " << return_str << std::endl;
-
+
//write announcements to local file, even if the
//announcement is empty
namespace ARDOUR {
-void pingback (const string& version, const string& announce_path)
+void pingback (const string& version, const string& announce_path)
{
+ if (ARDOUR_UI_UTILS::running_from_source_tree ()) {
+ /* we don't ping under these conditions, because the user is
+ probably just paul or robin :)
+ */
+ return;
+ }
+
ping_call* cm = new ping_call (version, announce_path);
pthread_t thread;