X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fardour_http.h;h=e209d75d9e4645127f7f170414777189426fff9b;hb=69194df4d9a2f985423eca7d44c3d3292cc8baad;hp=cabcb3d5bc06c9fa34c430d77e5e4693801a555c;hpb=004b57e9f67c6b818357759005c8e53b041dead4;p=ardour.git diff --git a/gtk2_ardour/ardour_http.h b/gtk2_ardour/ardour_http.h index cabcb3d5bc..e209d75d9e 100644 --- a/gtk2_ardour/ardour_http.h +++ b/gtk2_ardour/ardour_http.h @@ -21,6 +21,7 @@ #include #include +#include namespace ArdourCurl { @@ -35,11 +36,15 @@ class HttpGet { size_t size; }; - char* get (const char* url); + struct HeaderInfo { + std::map h; + }; + + char* get (const char* url, bool with_error_logging = false); - std::string get (const std::string& url) { - char *rv = get (url.c_str ()); - return rv ? std::string (rv) : std::string (); + std::string get (const std::string& url, bool with_error_logging = false) { + char *rv = get (url.c_str (), with_error_logging); + return rv ? std::string (rv) : std::string (""); } char* data () const { return mem.data; } @@ -47,6 +52,8 @@ class HttpGet { long int status () const { return _status; } + std::map header () const { return nfo.h; } + char* escape (const char* s, int l) const { return curl_easy_escape (_curl, s, l); } @@ -76,14 +83,16 @@ class HttpGet { char error_buffer[CURL_ERROR_SIZE]; struct MemStruct mem; + struct HeaderInfo nfo; static const char* ca_path; static const char* ca_info; }; -char* http_get (const char* url, int* status); +char* http_get (const char* url, int* status, bool with_error_logging); +std::string http_get (const std::string& url, bool with_error_logging); + -std::string http_get (const std::string& url); } // namespace