mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Decide if the file tree is read from db or stat'ed
This commit is contained in:
parent
1e41c469f0
commit
1dc50eea5d
@ -29,6 +29,7 @@
|
||||
#include <dlfcn.h> /* dlopen(), dlclose(), dlsym() ... */
|
||||
|
||||
#include "csync_private.h"
|
||||
#include "csync_dbtree.h"
|
||||
#include "vio/csync_vio.h"
|
||||
#include "vio/csync_vio_handle_private.h"
|
||||
#include "vio/csync_vio_local.h"
|
||||
@ -379,7 +380,12 @@ csync_vio_handle_t *csync_vio_opendir(CSYNC *ctx, const char *name) {
|
||||
|
||||
switch(ctx->replica) {
|
||||
case REMOTE_REPLCIA:
|
||||
mh = ctx->module.method->opendir(name);
|
||||
if(ctx->remote.read_from_db) {
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "Reading directory %s from database", name);
|
||||
mh = csync_dbtree_opendir(ctx, name);
|
||||
} else {
|
||||
mh = ctx->module.method->opendir(name);
|
||||
}
|
||||
break;
|
||||
case LOCAL_REPLICA:
|
||||
mh = csync_vio_local_opendir(name);
|
||||
@ -406,7 +412,11 @@ int csync_vio_closedir(CSYNC *ctx, csync_vio_handle_t *dhandle) {
|
||||
|
||||
switch(ctx->replica) {
|
||||
case REMOTE_REPLCIA:
|
||||
rc = ctx->module.method->closedir(dhandle->method_handle);
|
||||
if(ctx->remote.read_from_db) {
|
||||
rc = csync_dbtree_closedir(ctx, dhandle->method_handle);
|
||||
} else {
|
||||
rc = ctx->module.method->closedir(dhandle->method_handle);
|
||||
}
|
||||
break;
|
||||
case LOCAL_REPLICA:
|
||||
rc = csync_vio_local_closedir(dhandle->method_handle);
|
||||
@ -426,7 +436,11 @@ csync_vio_file_stat_t *csync_vio_readdir(CSYNC *ctx, csync_vio_handle_t *dhandle
|
||||
|
||||
switch(ctx->replica) {
|
||||
case REMOTE_REPLCIA:
|
||||
fs = ctx->module.method->readdir(dhandle->method_handle);
|
||||
if(ctx->remote.read_from_db) {
|
||||
fs = csync_dbtree_readdir(ctx, dhandle->method_handle);
|
||||
} else {
|
||||
fs = ctx->module.method->readdir(dhandle->method_handle);
|
||||
}
|
||||
break;
|
||||
case LOCAL_REPLICA:
|
||||
fs = csync_vio_local_readdir(dhandle->method_handle);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user