fixed some warnings and wrong usage of curl_easy_getinfo

Sat, 05 Mar 2016 19:28:24 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 05 Mar 2016 19:28:24 +0100
changeset 205
bf756f6c3581
parent 204
4f0207044837
child 206
527d0fde484e

fixed some warnings and wrong usage of curl_easy_getinfo

dav/config.c file | annotate | diff | comparison | revisions
dav/sync.c file | annotate | diff | comparison | revisions
libidav/davqlexec.c file | annotate | diff | comparison | revisions
libidav/resource.c file | annotate | diff | comparison | revisions
libidav/webdav.c file | annotate | diff | comparison | revisions
--- a/dav/config.c	Thu Mar 03 15:52:18 2016 +0100
+++ b/dav/config.c	Sat Mar 05 19:28:24 2016 +0100
@@ -519,7 +519,7 @@
     }
     xmlNodeAddContent(repoNode, BAD_CAST "\t");
     
-    xmlNodeAddContent(root, "\n\t");
+    xmlNodeAddContent(root, BAD_CAST "\n\t");
     xmlAddChild(root, repoNode);
     xmlNodeAddContent(root, BAD_CAST "\n");
     
--- a/dav/sync.c	Thu Mar 03 15:52:18 2016 +0100
+++ b/dav/sync.c	Sat Mar 05 19:28:24 2016 +0100
@@ -1119,7 +1119,7 @@
     }
     
     if(!syncdir->trash) {
-        printf("trash not configured\n", syncdir->name);
+        printf("trash not configured for %s\n", syncdir->name);
         return 0;
     }
     
--- a/libidav/davqlexec.c	Thu Mar 03 15:52:18 2016 +0100
+++ b/libidav/davqlexec.c	Sat Mar 05 19:28:24 2016 +0100
@@ -474,8 +474,8 @@
         
         util_set_url(sn, dav_resource_get_href(sr->resource));
         CURLcode ret = do_propfind_request(sn->handle, rqbuf, rpbuf);
-        int http_status = 0;
-        curl_easy_getinfo (sn->handle, CURLINFO_RESPONSE_CODE, &http_status);
+        long http_status = 0;
+        curl_easy_getinfo(sn->handle, CURLINFO_RESPONSE_CODE, &http_status);
         //printf("rpbuf: %s %s\n%.*s\n\n", sr->resource->path, sr->resource->href, rpbuf->pos, rpbuf->space);
         
         if(ret == CURLE_OK && http_status == 207) {
--- a/libidav/resource.c	Thu Mar 03 15:52:18 2016 +0100
+++ b/libidav/resource.c	Sat Mar 05 19:28:24 2016 +0100
@@ -609,7 +609,7 @@
                     data->length);
         }
         
-        int status = 0;
+        long status = 0;
         curl_easy_getinfo(sn->handle, CURLINFO_RESPONSE_CODE, &status);
         if(ret == CURLE_OK && (status >= 200 && status < 300)) {
             res->session->error = 0;
@@ -633,7 +633,7 @@
         //printf("request:\n%.*s\n\n", request->pos, request->space);
 
         CURLcode ret = do_proppatch_request(sn->handle, request, response);
-        int status = 0;
+        long status = 0;
         curl_easy_getinfo (sn->handle, CURLINFO_RESPONSE_CODE, &status);
         if(ret == CURLE_OK && status == 207) {
             //printf("%s\n", response->space);
@@ -690,7 +690,7 @@
         aes_decrypter_close(dec);
     }
     
-    int status = 0;
+    long status = 0;
     curl_easy_getinfo (handle, CURLINFO_RESPONSE_CODE, &status);
     if(ret == CURLE_OK && (status >= 200 && status < 300)) {
         int verify_failed = 0;
@@ -745,7 +745,7 @@
     
     UcxBuffer *response = ucx_buffer_new(NULL, 4096, UCX_BUFFER_AUTOEXTEND);
     CURLcode ret = do_delete_request(handle, response);
-    int status = 0;
+    long status = 0;
     curl_easy_getinfo (handle, CURLINFO_RESPONSE_CODE, &status);
     if(ret == CURLE_OK && (status >= 200 && status < 300)) {
         res->session->error = DAV_OK;
@@ -763,7 +763,7 @@
 static int create_ancestors(DavSession *sn, char *href, char *path) {
     CURL *handle = sn->handle;
     CURLcode code;
-    int status = 0;
+    long status = 0;
     int ret = 0;
     
     if(strlen(path) <= 1) {
@@ -820,7 +820,7 @@
     } else {
         code = do_put_request(handle, "", NULL, 0); 
     }
-    int s = 0;
+    long s = 0;
     curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &s);
     *status = s;
     if(code == CURLE_OK && (s >= 200 && s < 300)) {
@@ -862,7 +862,7 @@
     util_set_url(sn, dav_resource_get_href(res));
     
     CURLcode ret = do_head_request(handle);
-    int status = 0;
+    long status = 0;
     curl_easy_getinfo (handle, CURLINFO_RESPONSE_CODE, &status);
     if(ret == CURLE_OK && (status >= 200 && status < 300)) {
         return 1;
@@ -879,7 +879,7 @@
     
     CURLcode ret = do_copy_move_request(handle, desturl, copy, override);
     
-    int status = 0;
+    long status = 0;
     curl_easy_getinfo (handle, CURLINFO_RESPONSE_CODE, &status);
     if(ret == CURLE_OK && (status >= 200 && status < 300)) {
         return 0;
@@ -935,7 +935,7 @@
     util_set_url(sn, href);
     CURLcode ret = do_proppatch_request(sn->handle, request, response);
     ucx_buffer_free(request);
-    int status = 0;
+    long status = 0;
     curl_easy_getinfo (sn->handle, CURLINFO_RESPONSE_CODE, &status);
     if(ret == CURLE_OK && status == 207) {
         // TODO: parse response
--- a/libidav/webdav.c	Thu Mar 03 15:52:18 2016 +0100
+++ b/libidav/webdav.c	Sat Mar 05 19:28:24 2016 +0100
@@ -293,7 +293,7 @@
     //printf("\n");
     
     CURLcode ret = do_propfind_request(handle, rqbuf, rpbuf);
-    int status = 0;
+    long status = 0;
     curl_easy_getinfo (handle, CURLINFO_RESPONSE_CODE, &status);
     if(ret == CURLE_OK && status == 207) {
         //printf("response\n%s\n", rpbuf->space);
@@ -325,7 +325,7 @@
     DavResource *resource = root;
     CURLcode ret = do_propfind_request(handle, rqbuf, rpbuf);
     int status = 0;
-    int error = 0;
+    long error = 0;
     curl_easy_getinfo (handle, CURLINFO_RESPONSE_CODE, &status);
     if(ret == CURLE_OK && status == 207) {
         //printf("response\n%s\n", rpbuf->space); 

mercurial