Skip to content
Snippets Groups Projects
Commit 80ba4060 authored by Jakob Olsson's avatar Jakob Olsson
Browse files

libmobile_hilink.c: remove some debugging prints

parent e84be507
No related branches found
No related tags found
No related merge requests found
...@@ -51,13 +51,10 @@ struct json_object *xml_to_json_converter(struct string *result) ...@@ -51,13 +51,10 @@ struct json_object *xml_to_json_converter(struct string *result)
jobj = json_object_new_object(); jobj = json_object_new_object();
xml_to_json(origin_node, jobj); xml_to_json(origin_node, jobj);
//debug_print("Json object from xml: %s\n", json_object_to_json_string(jobj));
if (doc_ptr) if (doc_ptr)
xmlFreeDoc(doc_ptr); xmlFreeDoc(doc_ptr);
return jobj; return jobj;
fail_origin_node: fail_origin_node:
if (doc_ptr) if (doc_ptr)
xmlFreeDoc(doc_ptr); xmlFreeDoc(doc_ptr);
...@@ -191,24 +188,24 @@ static struct string *get_request(const char *url, const char *api_url) ...@@ -191,24 +188,24 @@ static struct string *get_request(const char *url, const char *api_url)
CURL *curl = NULL; CURL *curl = NULL;
CURLcode status; CURLcode status;
struct string *result; struct string *result;
printf("193\n");
curl = curl_easy_init(); curl = curl_easy_init();
if (!curl) if (!curl)
goto leave; goto leave;
printf("197\n");
result = memalloc_write_result(); result = memalloc_write_result();
if (!result) if (!result)
goto leave; goto leave;
printf("201\n");
prepare_curl_write_callback(curl, url, result); prepare_curl_write_callback(curl, url, result);
printf("203\n");
//curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); //start the cookie engine .. //curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); //start the cookie engine ..
//curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookies.txt"); //Save the cookie from the server to cookie.txt //curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookies.txt"); //Save the cookie from the server to cookie.txt
status = curl_easy_perform(curl); status = curl_easy_perform(curl);
if (check_cookie_status(status, curl)) if (check_cookie_status(status, curl))
goto leave; goto leave;
printf("210\n");
//Prepare result struct to get next http response. //Prepare result struct to get next http response.
//memset(result->ptr, 0, BUFFER_SIZE); //memset(result->ptr, 0, BUFFER_SIZE);
free(result->ptr); free(result->ptr);
...@@ -216,15 +213,14 @@ static struct string *get_request(const char *url, const char *api_url) ...@@ -216,15 +213,14 @@ static struct string *get_request(const char *url, const char *api_url)
if (!result->ptr) if (!result->ptr)
goto leave_calloc; goto leave_calloc;
result->len = 0; result->len = 0;
printf("214\n");
prepare_curl_write_callback(curl, api_url, result); prepare_curl_write_callback(curl, api_url, result);
//curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "cookies.txt"); //Read locally stored cookies //curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "cookies.txt"); //Read locally stored cookies
printf("217\n");
status = curl_easy_perform(curl); status = curl_easy_perform(curl);
if (check_cookie_status(status, curl)) if (check_cookie_status(status, curl))
goto leave; goto leave;
printf("222\n");
result->ptr[result->len] = '\0'; result->ptr[result->len] = '\0';
if (DEBUG_RESULT) if (DEBUG_RESULT)
printf("Http get request data is: %s\n", result->ptr); printf("Http get request data is: %s\n", result->ptr);
...@@ -259,8 +255,6 @@ static struct string *post_request(const char *url, const char *api_url, char *p ...@@ -259,8 +255,6 @@ static struct string *post_request(const char *url, const char *api_url, char *p
CURL *curl = NULL; CURL *curl = NULL;
CURLcode status; CURLcode status;
printf("\nurl %s\napi_url %s\npost_query %s\n", url, api_url, post_query);
curl = curl_easy_init(); curl = curl_easy_init();
if (!curl) if (!curl)
goto leave; goto leave;
...@@ -275,9 +269,7 @@ static struct string *post_request(const char *url, const char *api_url, char *p ...@@ -275,9 +269,7 @@ static struct string *post_request(const char *url, const char *api_url, char *p
if (check_cookie_status(status, curl)) if (check_cookie_status(status, curl))
goto leave; goto leave;
printf("result->ptr %s\n", result->ptr);
result->ptr[result->len] = '\0'; result->ptr[result->len] = '\0';
printf("result->ptr %s\n", result->ptr);
/*session_id = parser(result->ptr, "SessionID="); /*session_id = parser(result->ptr, "SessionID=");
if (DEBUG) if (DEBUG)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment