778 printf("mkcol: %s\n", local_res->path); |
778 printf("mkcol: %s\n", local_res->path); |
779 if(sync_mkdir(dir, res, local_res) && sn->error != DAV_METHOD_NOT_ALLOWED) { |
779 if(sync_mkdir(dir, res, local_res) && sn->error != DAV_METHOD_NOT_ALLOWED) { |
780 print_resource_error(sn, res->path); |
780 print_resource_error(sn, res->path); |
781 ret = -1; |
781 ret = -1; |
782 sync_error++; |
782 sync_error++; |
|
783 error = 1; |
783 } |
784 } |
784 } else { |
785 } else { |
785 if(cdt && remote_resource_is_changed(sn, dir, db, local_res)) { |
786 if(cdt && remote_resource_is_changed(sn, dir, db, local_res)) { |
786 printf("conflict: %s\n", local_res->path); |
787 printf("conflict: %s\n", local_res->path); |
787 sync_skipped++; |
788 sync_skipped++; |
791 printf("put: %s\n", local_res->path); |
792 printf("put: %s\n", local_res->path); |
792 if(sync_put_resource(dir, res, local_res, &sync_success)) { |
793 if(sync_put_resource(dir, res, local_res, &sync_success)) { |
793 sync_error++; |
794 sync_error++; |
794 print_resource_error(sn, res->path); |
795 print_resource_error(sn, res->path); |
795 ret = -1; |
796 ret = -1; |
796 sync_error++; |
|
797 error = 1; |
797 error = 1; |
798 } |
798 } |
799 } |
799 } |
800 dav_resource_free(res); |
800 dav_resource_free(res); |
801 } |
801 } |
1100 |
1100 |
1101 if(ret == 0) { |
1101 if(ret == 0) { |
1102 (*counter)++; |
1102 (*counter)++; |
1103 |
1103 |
1104 // check contentlength and get new etag |
1104 // check contentlength and get new etag |
1105 DavResource *up_res = dav_get(res->session, res->path, "D:getetag"); |
1105 DavResource *up_res = dav_get(res->session, res->path, "D:getetag,idav:status"); |
1106 |
1106 |
1107 if(up_res) { |
1107 if(up_res) { |
1108 // the new content length must be equal or greater than the file size |
1108 // the new content length must be equal or greater than the file size |
1109 if(up_res->contentlength < s.st_size) { |
1109 if(up_res->contentlength < s.st_size) { |
1110 fprintf(stderr, "Incomplete Upload: %s", local_path); |
1110 fprintf(stderr, "Incomplete Upload: %s", local_path); |