Before this patch, to deep folder would just be ignored, without any feedback.
This patch makes it so deep folder are properly shown as ignored in the UI.
Also increase the MAX_DEPTH
Issue: #1067
CSYNC_STATUS_INDIVIDUAL_EXCLUDE_HIDDEN,
CSYNC_STATUS_INVALID_CHARACTERS,
CSYNC_STATUS_INDIVIDUAL_STAT_FAILED,
- CSYNC_STATUS_FORBIDDEN
+ CSYNC_STATUS_FORBIDDEN,
+ CSYNC_STATUS_INDIVIDUAL_TOO_DEEP
};
typedef enum csync_status_codes_e CSYNC_STATUS;
/**
* How deep to scan directories.
*/
-#define MAX_DEPTH 50
+#define MAX_DEPTH 100
#define CSYNC_STATUS_INIT 1 << 0
#define CSYNC_STATUS_UPDATE 1 << 1
int rc = 0;
int res = 0;
+ if (!depth) {
+ mark_current_item_ignored(ctx, previous_fs, CSYNC_STATUS_INDIVIDUAL_TOO_DEEP);
+ goto done;
+ }
+
bool do_read_from_db = (ctx->current == REMOTE_REPLICA && ctx->remote.read_from_db);
read_from_db = ctx->remote.read_from_db;
goto error;
}
- if (flag == CSYNC_FTW_FLAG_DIR && depth && rc == 0
+ if (flag == CSYNC_FTW_FLAG_DIR && rc == 0
&& (!ctx->current_fs || ctx->current_fs->instruction != CSYNC_INSTRUCTION_IGNORE)) {
rc = csync_ftw(ctx, filename, fn, depth - 1);
if (rc < 0) {
case CSYNC_STATUS_INDIVIDUAL_EXCLUDE_HIDDEN:
item->_errorString = tr("File/Folder is ignored because it's hidden.");
break;
+ case CSYNC_STATUS_INDIVIDUAL_TOO_DEEP:
+ item->_errorString = tr("Folder hierarchy is too deep");
+ break;
case CYSNC_STATUS_FILE_LOCKED_OR_OPEN:
item->_errorString = QLatin1String("File locked"); // don't translate, internal use!
break;