Do not save for resume if there is an error from the server

errors (such as 500) may mean the the server do not suport
resuming
This commit is contained in:
Olivier Goffart 2013-07-15 10:48:14 +02:00 committed by Klaas Freitag
parent 1263ca990d
commit 6beb96293f

View File

@ -387,7 +387,9 @@ start_fd_based:
if (_push_to_tmp_first(ctx)) {
csync_vio_file_stat_t* sb = csync_vio_file_stat_new();
if (csync_vio_stat(ctx, turi, sb) == 0 && sb->size > 0) {
if (csync_vio_stat(ctx, turi, sb) == 0 && sb->size > 0
&& errno != EIO) {
/* EIO is mapped to error from owncloud like 500 for which we don't want to resume */
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE,
"keeping tmp file: %s", turi);
if (!progress_info) {