Skip to content
Snippets Groups Projects
Commit 0015db7c authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS: added logging and missing parantheses

parent c5ba3df4
No related branches found
No related tags found
No related merge requests found
...@@ -182,6 +182,8 @@ bool TMSSBridge::httpQuery(const string& target, string &result, const string& q ...@@ -182,6 +182,8 @@ bool TMSSBridge::httpQuery(const string& target, string &result, const string& q
} }
else if (query_method == "PUT" || query_method == "PATCH" ) else if (query_method == "PUT" || query_method == "PATCH" )
{ {
LOG_INFO_STR("[" << query_method << "] url=" << url << " data=" << data);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, query_method.c_str()); curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, query_method.c_str());
curl_easy_setopt(curl, CURLOPT_USERAGENT, "TMSSBridge using libcurl"); curl_easy_setopt(curl, CURLOPT_USERAGENT, "TMSSBridge using libcurl");
...@@ -223,9 +225,10 @@ bool TMSSBridge::httpQuery(const string& target, string &result, const string& q ...@@ -223,9 +225,10 @@ bool TMSSBridge::httpQuery(const string& target, string &result, const string& q
curl_global_cleanup(); curl_global_cleanup();
LOG_INFO_STR("[" << query_method << "] code=" << httpCode << " " << url); LOG_INFO_STR("[" << query_method << "] code=" << httpCode << " " << url);
if (httpCode == 200) if (httpCode == 200) {
result = string(*httpData.get()); result = string(*httpData.get());
return true; return true;
}
LOG_ERROR_STR("Couldn't " + query_method + " from " + url + " exiting with http code " + to_string(httpCode)); LOG_ERROR_STR("Couldn't " + query_method + " from " + url + " exiting with http code " + to_string(httpCode));
result = ""; result = "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment