mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Fix ArdourHTTP error reporting
This commit is contained in:
parent
e10c162efb
commit
720292696a
1 changed files with 4 additions and 3 deletions
|
|
@ -127,7 +127,7 @@ HttpGet::HttpGet (bool p, bool ssl)
|
||||||
, _status (-1)
|
, _status (-1)
|
||||||
, _result (-1)
|
, _result (-1)
|
||||||
{
|
{
|
||||||
error_buffer[0] = '\0';
|
memset (error_buffer, 0, sizeof (*error_buffer));
|
||||||
_curl = curl_easy_init ();
|
_curl = curl_easy_init ();
|
||||||
|
|
||||||
curl_easy_setopt (_curl, CURLOPT_WRITEDATA, (void *)&mem);
|
curl_easy_setopt (_curl, CURLOPT_WRITEDATA, (void *)&mem);
|
||||||
|
|
@ -172,6 +172,7 @@ HttpGet::get (const char* url)
|
||||||
free (mem.data);
|
free (mem.data);
|
||||||
} // otherwise caller is expected to have free()d or re-used it.
|
} // otherwise caller is expected to have free()d or re-used it.
|
||||||
|
|
||||||
|
memset (error_buffer, 0, sizeof (*error_buffer));
|
||||||
mem.data = NULL;
|
mem.data = NULL;
|
||||||
mem.size = 0;
|
mem.size = 0;
|
||||||
|
|
||||||
|
|
@ -180,11 +181,11 @@ HttpGet::get (const char* url)
|
||||||
curl_easy_getinfo (_curl, CURLINFO_RESPONSE_CODE, &_status);
|
curl_easy_getinfo (_curl, CURLINFO_RESPONSE_CODE, &_status);
|
||||||
|
|
||||||
if (_result) {
|
if (_result) {
|
||||||
PBD::error << string_compose (_("HTTP request failed: (%1) %2"), _result, error_buffer);
|
PBD::error << string_compose (_("HTTP request failed: (%1) %2"), _result, error_buffer) << endmsg;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (_status != 200) {
|
if (_status != 200) {
|
||||||
PBD::error << string_compose (_("HTTP request status: %1"), _status);
|
PBD::error << string_compose (_("HTTP request status: %1"), _status) << endmsg;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue