From acd33bbbad6c1b30830ee25afc510a11cb72a6f1 Mon Sep 17 00:00:00 2001 From: lukas-heiligenbrunner Date: Sun, 5 May 2019 20:23:31 +0200 Subject: [PATCH] edited some pointer references --- src/API.cpp | 9 ++++----- src/API.h | 2 +- src/main.cpp | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/API.cpp b/src/API.cpp index 51c0e37..67664b2 100644 --- a/src/API.cpp +++ b/src/API.cpp @@ -3,14 +3,14 @@ // #include "API.h" +#include "Hashmap.h" #include #include - -#include "curl/curl.h" #include -#include "Hashmap.h" +#include + std::string API::request(std::string myurl) { Hashmap map; @@ -19,7 +19,7 @@ std::string API::request(std::string myurl) { return request(myurl,false,map,str); } -std::string API::request(std::string myurl, bool post, Hashmap &map, std::vector headers) { +std::string API::request(std::string myurl, bool post, Hashmap &map, std::vector &headers) { CURL *curl; CURLcode res; @@ -52,7 +52,6 @@ std::string API::request(std::string myurl, bool post, Hashmap &map,std::vector headers); + std::string request(std::string myurl, bool post, Hashmap &map,std::vector &headers); private: static size_t write_data(void *buffer, size_t size, size_t buffersize, FILE *stream); diff --git a/src/main.cpp b/src/main.cpp index 008e61d..3dee134 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,9 +21,9 @@ int main() { if(oldip == ip){ std::cout << "no change -- ip: " << ip << std::endl; - logger.logToLogfile("no change -- ip: "+ip); + logger.logToLogfile(" [INFO] no change -- ip: "+ip); } else{ - logger.logToLogfile("ip changed! -- from :" + oldip + "to: "+ip); + logger.logToLogfile(" [INFO] ip changed! -- from :" + oldip + "to: "+ip); std::cout << "ip changed! -- from :" << oldip << "to: " << ip << std::endl; //api key: 88vNpMfDhMM2YYDNfWR1DNYfRX9W6fYg @@ -40,7 +40,7 @@ int main() { std::string dynurepl = api.request("https://api.dynu.com/v2/dns/8506047",true, args,headers); - std::cout << "---" << dynurepl << std::endl; + std::cout << "[ DEBUG ] api reply:: " << dynurepl << std::endl; if (dynurepl != "{\"statusCode\":200}"){ logger.logToLogfile(" [ERROR] failed to write ip to dynu api!");