Ejemplo n.º 1
0
csync_vio_handle_t *csync_vio_opendir(CSYNC *ctx, const char *name) {
  switch(ctx->replica) {
    case REMOTE_REPLICA:
      if(ctx->remote.read_from_db) {
          CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "Read from db flag is true, should not!" );
      }
      return owncloud_opendir(name);
      break;
    case LOCAL_REPLICA:
      return csync_vio_local_opendir(name);
      break;
    default:
      CSYNC_LOG(CSYNC_LOG_PRIORITY_ALERT, "Invalid replica (%d)", (int)ctx->replica);
      break;
  }
  return NULL;
}
Ejemplo n.º 2
0
csync_vio_handle_t *csync_vio_opendir(CSYNC *ctx, const char *name) {
  switch(ctx->replica) {
    case REMOTE_REPLICA:
      if(ctx->remote.read_from_db) {
          CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "Read from db flag is true, should not!" );
      }
      return ctx->callbacks.remote_opendir_hook(name, ctx->callbacks.vio_userdata);
      break;
    case LOCAL_REPLICA:
	if( ctx->callbacks.update_callback ) {
        ctx->callbacks.update_callback(ctx->replica, name, ctx->callbacks.update_callback_userdata);
	}
      return csync_vio_local_opendir(name);
      break;
    default:
      CSYNC_LOG(CSYNC_LOG_PRIORITY_ALERT, "Invalid replica (%d)", (int)ctx->replica);
      break;
  }
  return NULL;
}