diff --git a/ci/run.py b/ci/run.py index ab412f8..13d8bca 100755 --- a/ci/run.py +++ b/ci/run.py @@ -190,7 +190,6 @@ def fetch_and_build(): libsearpc.compile_and_install() libevhtp.compile_and_install() - ccnet.compile_and_install() seafile.compile_and_install() diff --git a/ci/serverctl.py b/ci/serverctl.py index 76f0bc0..d25de9a 100755 --- a/ci/serverctl.py +++ b/ci/serverctl.py @@ -50,16 +50,8 @@ class ServerCtl(object): self.init_seafile() def init_ccnet(self): - cmd = [ - 'ccnet-init', - '-F', - self.central_conf_dir, - '-c', - self.ccnet_conf_dir, - '--host', - 'test.seafile.com', - ] - shell(cmd) + os.mkdir (self.central_conf_dir, 0o755) + os.mkdir (self.ccnet_conf_dir, 0o755) if self.db == 'mysql': self.add_ccnet_db_conf() else: diff --git a/common/common.h b/common/common.h index 2b289c4..eac21e9 100644 --- a/common/common.h +++ b/common/common.h @@ -53,4 +53,6 @@ #define ccnet_debug(fmt, ...) g_debug(fmt, ##__VA_ARGS__) #endif +#define DEFAULT_CONFIG_DIR "~/.ccnet" + #endif diff --git a/common/fs-mgr.c b/common/fs-mgr.c index eeaf93a..6c0517e 100644 --- a/common/fs-mgr.c +++ b/common/fs-mgr.c @@ -2,8 +2,6 @@ #include "common.h" -#include - #include #include #include diff --git a/common/group-mgr.c b/common/group-mgr.c index 36daa30..e5238ab 100644 --- a/common/group-mgr.c +++ b/common/group-mgr.c @@ -2,8 +2,6 @@ #include "common.h" -#include - #include "seafile-session.h" #include "seaf-db.h" #include "group-mgr.h" diff --git a/common/mq-mgr.h b/common/mq-mgr.h index 443d3d1..d300141 100644 --- a/common/mq-mgr.h +++ b/common/mq-mgr.h @@ -1,6 +1,8 @@ #ifndef SEAF_MQ_MANAGER_H #define SEAF_MQ_MANAGER_H +#include + #define SEAFILE_SERVER_CHANNEL_EVENT "seaf_server.event" #define SEAFILE_SERVER_CHANNEL_STATS "seaf_server.stats" diff --git a/common/org-mgr.c b/common/org-mgr.c index 6b395c7..0b336ef 100644 --- a/common/org-mgr.c +++ b/common/org-mgr.c @@ -2,8 +2,6 @@ #include "common.h" -#include - #include "seafile-session.h" #include "seaf-db.h" #include "org-mgr.h" diff --git a/common/rpc-service.c b/common/rpc-service.c index 2f2f7cf..ae3b448 100644 --- a/common/rpc-service.c +++ b/common/rpc-service.c @@ -6,7 +6,6 @@ #include #include -#include #include "utils.h" #include "seafile-session.h" diff --git a/common/user-mgr.c b/common/user-mgr.c index bcb7950..8629897 100644 --- a/common/user-mgr.c +++ b/common/user-mgr.c @@ -5,7 +5,6 @@ #include #include -#include #include "utils.h" #include "seafile-session.h" diff --git a/common/user-mgr.h b/common/user-mgr.h index ebe8a81..b747f21 100644 --- a/common/user-mgr.h +++ b/common/user-mgr.h @@ -5,7 +5,6 @@ #include #include -#include #define CCNET_TYPE_USER_MANAGER (ccnet_user_manager_get_type ()) #define CCNET_USER_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CCNET_TYPE_USER_MANAGER, CcnetUserManager)) diff --git a/configure.ac b/configure.ac index 9a93a00..ce44fff 100644 --- a/configure.ac +++ b/configure.ac @@ -189,7 +189,6 @@ AC_SUBST(LIB_ICONV) LIBEVENT_REQUIRED=2.0 GLIB_REQUIRED=2.16.0 -CCNET_REQUIRED=0.9.3 SEARPC_REQUIRED=1.0 JANSSON_REQUIRED=2.2.1 ZDB_REQUIRED=2.10 @@ -210,10 +209,6 @@ PKG_CHECK_MODULES(GOBJECT, [gobject-2.0 >= $GLIB_REQUIRED]) AC_SUBST(GOBJECT_CFLAGS) AC_SUBST(GOBJECT_LIBS) -PKG_CHECK_MODULES(CCNET, [libccnet >= $CCNET_REQUIRED]) -AC_SUBST(CCNET_CFLAGS) -AC_SUBST(CCNET_LIBS) - PKG_CHECK_MODULES(SEARPC, [libsearpc >= $SEARPC_REQUIRED]) AC_SUBST(SEARPC_CFLAGS) AC_SUBST(SEARPC_LIBS) diff --git a/controller/Makefile.am b/controller/Makefile.am index ad85b35..3c71aea 100644 --- a/controller/Makefile.am +++ b/controller/Makefile.am @@ -6,7 +6,6 @@ AM_CFLAGS = \ -I$(top_srcdir)/lib \ -I$(top_builddir)/lib \ -I$(top_srcdir)/common \ - @CCNET_CFLAGS@ \ @SEARPC_CFLAGS@ \ @GLIB2_CFLAGS@ \ -Wall @@ -15,7 +14,6 @@ noinst_HEADERS = seafile-controller.h ../common/log.h seafile_controller_SOURCES = seafile-controller.c ../common/log.c -seafile_controller_LDADD = @CCNET_LIBS@ \ - $(top_builddir)/lib/libseafile_common.la \ +seafile_controller_LDADD = $(top_builddir)/lib/libseafile_common.la \ @GLIB2_LIBS@ @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ @LIBEVENT_LIBS@ \ @SEARPC_LIBS@ @JANSSON_LIBS@ @ZLIB_LIBS@ diff --git a/controller/seafile-controller.c b/controller/seafile-controller.c index 3dde027..63753a7 100644 --- a/controller/seafile-controller.c +++ b/controller/seafile-controller.c @@ -11,7 +11,6 @@ #include #include -#include #include "utils.h" #include "log.h" diff --git a/controller/seafile-controller.h b/controller/seafile-controller.h index d4bbe35..1b4403e 100644 --- a/controller/seafile-controller.h +++ b/controller/seafile-controller.h @@ -44,10 +44,6 @@ struct _SeafileController { char *rpc_pipe_path; char *logdir; - CcnetClient *client; - CcnetClient *sync_client; - CcnetMqclientProc *mqclient_proc; - guint check_process_timer; guint client_io_id; /* Decide whether to start seaf-server in cloud mode */ diff --git a/fuse/Makefile.am b/fuse/Makefile.am index a1b33e3..3f3f176 100644 --- a/fuse/Makefile.am +++ b/fuse/Makefile.am @@ -5,7 +5,6 @@ AM_CFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \ -I$(top_srcdir)/lib \ -I$(top_builddir)/lib \ -I$(top_srcdir)/common \ - @CCNET_CFLAGS@ \ @SEARPC_CFLAGS@ \ @GLIB2_CFLAGS@ \ @FUSE_CFLAGS@ \ @@ -39,8 +38,7 @@ seaf_fuse_SOURCES = seaf-fuse.c \ ../common/obj-backend-riak.c \ ../common/seafile-crypt.c -seaf_fuse_LDADD = @CCNET_LIBS@ \ - @GLIB2_LIBS@ @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ \ +seaf_fuse_LDADD = @GLIB2_LIBS@ @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ \ -lsqlite3 @LIBEVENT_LIBS@ \ $(top_builddir)/common/cdc/libcdc.la \ @SEARPC_LIBS@ @JANSSON_LIBS@ @FUSE_LIBS@ @ZLIB_LIBS@ \ diff --git a/fuse/file.c b/fuse/file.c index ce7696a..ef83ed3 100644 --- a/fuse/file.c +++ b/fuse/file.c @@ -6,7 +6,6 @@ #include #include -#include #include #include "log.h" diff --git a/fuse/getattr.c b/fuse/getattr.c index 60ec437..a91799a 100644 --- a/fuse/getattr.c +++ b/fuse/getattr.c @@ -6,8 +6,6 @@ #include #include -#include -#include #include #include "log.h" diff --git a/fuse/readdir.c b/fuse/readdir.c index 2e17f67..fe689c1 100644 --- a/fuse/readdir.c +++ b/fuse/readdir.c @@ -6,8 +6,6 @@ #include #include -#include -#include #include #include "log.h" diff --git a/fuse/repo-mgr.c b/fuse/repo-mgr.c index 0165a54..36ec1fb 100644 --- a/fuse/repo-mgr.c +++ b/fuse/repo-mgr.c @@ -3,7 +3,6 @@ #include "common.h" #include -#include #include "utils.h" #include "log.h" diff --git a/fuse/seaf-fuse.c b/fuse/seaf-fuse.c index b5d36e4..de9825d 100644 --- a/fuse/seaf-fuse.c +++ b/fuse/seaf-fuse.c @@ -10,7 +10,6 @@ #include #include -#include #include #include "log.h" diff --git a/fuse/seafile-session.c b/fuse/seafile-session.c index 469c3e3..c627347 100644 --- a/fuse/seafile-session.c +++ b/fuse/seafile-session.c @@ -4,7 +4,6 @@ #include #include -#include #include #include diff --git a/lib/Makefile.am b/lib/Makefile.am index 88df2e9..3bbacf6 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -5,7 +5,6 @@ pkgconfigdir = $(libdir)/pkgconfig AM_CPPFLAGS = @GLIB2_CFLAGS@ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/common \ - @CCNET_CFLAGS@ \ @SEARPC_CFLAGS@ \ @MSVC_CFLAGS@ \ -Wall @@ -14,7 +13,7 @@ BUILT_SOURCES = gensource ## source file rules seafile_object_define = repo.vala commit.vala dirent.vala dir.vala \ - task.vala branch.vala crypt.vala webaccess.vala copy-task.vala + task.vala branch.vala crypt.vala webaccess.vala copy-task.vala ccnetobj.vala seafile_object_gen = $(seafile_object_define:.vala=.c) @@ -22,7 +21,7 @@ valac_gen = ${seafile_object_gen} seafile-object.h EXTRA_DIST = ${seafile_object_define} rpc_table.py $(pcfiles) vala.stamp -utils_headers = net.h bloom-filter.h utils.h db.h +utils_headers = net.h bloom-filter.h utils.h db.h job-mgr.h timer.h utils_srcs = $(utils_headers:.h=.c) diff --git a/lib/ccnetobj.vala b/lib/ccnetobj.vala new file mode 100644 index 0000000..9c3c583 --- /dev/null +++ b/lib/ccnetobj.vala @@ -0,0 +1,49 @@ + + +namespace Ccnet { + + +public class EmailUser : Object { + + public int id { get; set; } + public string email { get; set; } + public bool is_staff { get; set; } + public bool is_active { get; set; } + public int64 ctime { get; set; } + public string source { get; set; } + public string role { get; set; } + public string password { get; set; } + public string reference_id { get; set; } +} + +public class Group : Object { + + public int id { get; set; } + public string group_name { get; set; } + public string creator_name { get; set; } + public int64 timestamp { get; set; } + public string source { get; set; } + public int parent_group_id { get; set; } + +} + +public class GroupUser : Object { + + public int group_id { get; set; } + public string user_name { get; set; } + public int is_staff { get; set; } +} + +public class Organization : Object { + + public int org_id { get; set; } + public string email { get; set; } + public int is_staff { get; set; } + public string org_name { get; set; } + public string url_prefix { get; set; } + public string creator { get; set; } + public int64 ctime { get; set; } + +} + +} // namespace diff --git a/lib/include.h b/lib/include.h index 63f3ac6..b85703e 100644 --- a/lib/include.h +++ b/lib/include.h @@ -9,7 +9,6 @@ #include #include "utils.h" -#include #ifndef ccnet_warning #define ccnet_warning(fmt, ...) g_warning( "%s: " fmt, __func__ , ##__VA_ARGS__) diff --git a/lib/job-mgr.c b/lib/job-mgr.c new file mode 100644 index 0000000..63ec23a --- /dev/null +++ b/lib/job-mgr.c @@ -0,0 +1,167 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#include +#include +#else +#include +#endif + +#include +#include +#include +#include + +#define MAX_THREADS 50 +#define MAX_IDLE_THREADS 10 + +#include "utils.h" + +#include "job-mgr.h" + +struct _CcnetJob { + CcnetJobManager *manager; + + int id; + ccnet_pipe_t pipefd[2]; + + JobThreadFunc thread_func; + JobDoneCallback done_func; /* called when the thread is done */ + void *data; + + /* the done callback should only access this field */ + void *result; +}; + + +void +ccnet_job_manager_remove_job (CcnetJobManager *mgr, int job_id); + +static void +job_thread_wrapper (void *vdata, void *unused) +{ + CcnetJob *job = vdata; + + + job->result = job->thread_func (job->data); + if (pipewriten (job->pipefd[1], "a", 1) != 1) { + g_warning ("[Job Manager] write to pipe error: %s\n", strerror(errno)); + } +} + +static void +job_done_cb (evutil_socket_t fd, short event, void *vdata) +{ + CcnetJob *job = vdata; + char buf[1]; + + if (pipereadn (job->pipefd[0], buf, 1) != 1) { + g_warning ("[Job Manager] read pipe error: %s\n", strerror(errno)); + } + pipeclose (job->pipefd[0]); + pipeclose (job->pipefd[1]); + if (job->done_func) { + job->done_func (job->result); + } + + ccnet_job_manager_remove_job (job->manager, job->id); +} + +int +job_thread_create (CcnetJob *job) +{ + if (ccnet_pipe (job->pipefd) < 0) { + g_warning ("pipe error: %s\n", strerror(errno)); + return -1; + } + + g_thread_pool_push (job->manager->thread_pool, job, NULL); + +#ifndef UNIT_TEST + event_once (job->pipefd[0], EV_READ, job_done_cb, job, NULL); +#endif + + return 0; +} + +CcnetJob * +ccnet_job_new () +{ + CcnetJob *job; + + job = g_new0 (CcnetJob, 1); + return job; +} + +void +ccnet_job_free (CcnetJob *job) +{ + g_free (job); +} + +CcnetJobManager * +ccnet_job_manager_new (int max_threads) +{ + CcnetJobManager *mgr; + + mgr = g_new0 (CcnetJobManager, 1); + mgr->jobs = g_hash_table_new_full (g_direct_hash, g_direct_equal, + NULL, (GDestroyNotify)ccnet_job_free); + mgr->thread_pool = g_thread_pool_new (job_thread_wrapper, + NULL, + max_threads, + FALSE, + NULL); + /* g_thread_pool_set_max_unused_threads (MAX_IDLE_THREADS); */ + + return mgr; +} + +void +ccnet_job_manager_free (CcnetJobManager *mgr) +{ + g_hash_table_destroy (mgr->jobs); + g_thread_pool_free (mgr->thread_pool, TRUE, FALSE); + g_free (mgr); +} + +int +ccnet_job_manager_schedule_job (CcnetJobManager *mgr, + JobThreadFunc func, + JobDoneCallback done_func, + void *data) +{ + CcnetJob *job = ccnet_job_new (); + job->id = mgr->next_job_id++; + job->manager = mgr; + job->thread_func = func; + job->done_func = done_func; + job->data = data; + + g_hash_table_insert (mgr->jobs, (gpointer)(long)job->id, job); + + if (job_thread_create (job) < 0) { + g_hash_table_remove (mgr->jobs, (gpointer)(long)job->id); + return -1; + } + + return job->id; +} + +void +ccnet_job_manager_remove_job (CcnetJobManager *mgr, int job_id) +{ + g_hash_table_remove (mgr->jobs, (gpointer)(long)job_id); +} + +#ifdef UNIT_TEST +void +ccnet_job_manager_wait_job (CcnetJobManager *mgr, int job_id) +{ + CcnetJob *job; + + job = g_hash_table_lookup (mgr->jobs, (gpointer)(long)job_id); + /* manually call job_done_cb */ + job_done_cb (0, 0, (void *)job); +} +#endif diff --git a/lib/job-mgr.h b/lib/job-mgr.h new file mode 100644 index 0000000..0a779ef --- /dev/null +++ b/lib/job-mgr.h @@ -0,0 +1,57 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + +/** + * Job Manager manages long term jobs. These jobs are run in their + * own threads. + */ + +#ifndef JOB_MGR_H +#define JOB_MGR_H + +#include + +struct _CcnetSession; + +typedef struct _CcnetJob CcnetJob; +typedef struct _CcnetJobManager CcnetJobManager; + +/* + The thread func should return the result back by + return (void *)result; + The result will be passed to JobDoneCallback. + */ +typedef void* (*JobThreadFunc)(void *data); +typedef void (*JobDoneCallback)(void *result); + + +struct _CcnetJobManager { + GHashTable *jobs; + + GThreadPool *thread_pool; + + int next_job_id; +}; + +void +ccnet_job_cancel (CcnetJob *job); + +CcnetJobManager * +ccnet_job_manager_new (int max_threads); + +void +ccnet_job_manager_free (CcnetJobManager *mgr); + +int +ccnet_job_manager_schedule_job (CcnetJobManager *mgr, + JobThreadFunc func, + JobDoneCallback done_func, + void *data); + +/** + * Wait a specific job to be done. + */ +void +ccnet_job_manager_wait_job (CcnetJobManager *mgr, int job_id); + + +#endif diff --git a/lib/timer.c b/lib/timer.c new file mode 100644 index 0000000..8c04105 --- /dev/null +++ b/lib/timer.c @@ -0,0 +1,76 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#include +#include +#include +#else +#include +#endif + +#include + +#include "utils.h" + +#include "timer.h" + +struct CcnetTimer +{ + struct event event; + struct timeval tv; + TimerCB func; + void *user_data; + uint8_t inCallback; +}; + +static void +timer_callback (evutil_socket_t fd, short event, void *vtimer) +{ + int more; + struct CcnetTimer *timer = vtimer; + + timer->inCallback = 1; + more = (*timer->func) (timer->user_data); + timer->inCallback = 0; + + if (more) + evtimer_add (&timer->event, &timer->tv); + else + ccnet_timer_free (&timer); +} + +void +ccnet_timer_free (CcnetTimer **ptimer) +{ + CcnetTimer *timer; + + /* zero out the argument passed in */ + g_return_if_fail (ptimer); + + timer = *ptimer; + *ptimer = NULL; + + /* destroy the timer directly or via the command queue */ + if (timer && !timer->inCallback) + { + event_del (&timer->event); + g_free (timer); + } +} + +CcnetTimer* +ccnet_timer_new (TimerCB func, + void *user_data, + uint64_t interval_milliseconds) +{ + CcnetTimer *timer = g_new0 (CcnetTimer, 1); + + timer->tv = timeval_from_msec (interval_milliseconds); + timer->func = func; + timer->user_data = user_data; + + evtimer_set (&timer->event, timer_callback, timer); + evtimer_add (&timer->event, &timer->tv); + + return timer; +} diff --git a/lib/timer.h b/lib/timer.h new file mode 100644 index 0000000..eafe312 --- /dev/null +++ b/lib/timer.h @@ -0,0 +1,28 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + +#ifndef CCNET_TIMER_H +#define CCNET_TIMER_H + +/* return TRUE to reschedule the timer, return FALSE to cancle the timer */ +typedef int (*TimerCB) (void *data); + +struct CcnetTimer; + +typedef struct CcnetTimer CcnetTimer; + +/** + * Calls timer_func(user_data) after the specified interval. + * The timer is freed if timer_func returns zero. + * Otherwise, it's called again after the same interval. + */ +CcnetTimer* ccnet_timer_new (TimerCB func, + void *user_data, + uint64_t timeout_milliseconds); + +/** + * Frees a timer and sets the timer pointer to NULL. + */ +void ccnet_timer_free (CcnetTimer **timer); + + +#endif diff --git a/python/seaserv/service.py b/python/seaserv/service.py index 580d89f..96fe3b6 100644 --- a/python/seaserv/service.py +++ b/python/seaserv/service.py @@ -6,7 +6,6 @@ import sys import configparser from urllib.parse import urlparse -import ccnet import seafile import re from pysearpc import SearpcError diff --git a/server/Makefile.am b/server/Makefile.am index a91fd7f..49150c2 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -8,7 +8,6 @@ AM_CFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \ -I$(top_srcdir)/lib \ -I$(top_builddir)/lib \ -I$(top_srcdir)/common \ - @CCNET_CFLAGS@ \ @SEARPC_CFLAGS@ \ @GLIB2_CFLAGS@ \ @MSVC_CFLAGS@ \ @@ -77,8 +76,7 @@ seaf_server_SOURCES = \ ../common/merge-new.c \ ../common/block-tx-utils.c -seaf_server_LDADD = @CCNET_LIBS@ \ - $(top_builddir)/lib/libseafile_common.la \ +seaf_server_LDADD = $(top_builddir)/lib/libseafile_common.la \ @GLIB2_LIBS@ @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ -lsqlite3 @LIBEVENT_LIBS@ -levhtp \ $(top_builddir)/common/cdc/libcdc.la \ @SEARPC_LIBS@ @JANSSON_LIBS@ ${LIB_WS32} @ZLIB_LIBS@ \ diff --git a/server/access-file.c b/server/access-file.c index 23b99e2..e5a08c4 100644 --- a/server/access-file.c +++ b/server/access-file.c @@ -17,8 +17,6 @@ #include #include -#include - #include "seafile-object.h" #include "seafile-crypt.h" diff --git a/server/copy-mgr.c b/server/copy-mgr.c index 5505104..407a283 100644 --- a/server/copy-mgr.c +++ b/server/copy-mgr.c @@ -3,8 +3,6 @@ #include -#include - #include "seafile-session.h" #include "seafile-object.h" #include "seafile-error.h" diff --git a/server/gc/Makefile.am b/server/gc/Makefile.am index 07063fd..e45a4cb 100644 --- a/server/gc/Makefile.am +++ b/server/gc/Makefile.am @@ -6,7 +6,6 @@ AM_CFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \ -I$(top_srcdir)/lib \ -I$(top_builddir)/lib \ -I$(top_srcdir)/common \ - @CCNET_CFLAGS@ \ @SEARPC_CFLAGS@ \ @GLIB2_CFLAGS@ \ @MSVC_CFLAGS@ \ @@ -45,8 +44,7 @@ seafserv_gc_SOURCES = \ gc-core.c \ $(common_sources) -seafserv_gc_LDADD = @CCNET_LIBS@ \ - $(top_builddir)/common/cdc/libcdc.la \ +seafserv_gc_LDADD = $(top_builddir)/common/cdc/libcdc.la \ $(top_builddir)/lib/libseafile_common.la \ @GLIB2_LIBS@ @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ -lsqlite3 @LIBEVENT_LIBS@ \ @SEARPC_LIBS@ @JANSSON_LIBS@ ${LIB_WS32} @ZLIB_LIBS@ \ @@ -57,8 +55,7 @@ seaf_fsck_SOURCES = \ fsck.c \ $(common_sources) -seaf_fsck_LDADD = @CCNET_LIBS@ \ - $(top_builddir)/common/cdc/libcdc.la \ +seaf_fsck_LDADD = $(top_builddir)/common/cdc/libcdc.la \ $(top_builddir)/lib/libseafile_common.la \ @GLIB2_LIBS@ @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ -lsqlite3 @LIBEVENT_LIBS@ \ @SEARPC_LIBS@ @JANSSON_LIBS@ ${LIB_WS32} @ZLIB_LIBS@ \ diff --git a/server/gc/repo-mgr.c b/server/gc/repo-mgr.c index 45ebca3..58f21cc 100644 --- a/server/gc/repo-mgr.c +++ b/server/gc/repo-mgr.c @@ -3,7 +3,6 @@ #include "common.h" #include -#include #include "utils.h" #include "log.h" diff --git a/server/gc/seaf-fsck.c b/server/gc/seaf-fsck.c index 9a3be56..3595208 100644 --- a/server/gc/seaf-fsck.c +++ b/server/gc/seaf-fsck.c @@ -3,8 +3,6 @@ #include -#include - #include "seafile-session.h" #include "fsck.h" diff --git a/server/gc/seafile-session.c b/server/gc/seafile-session.c index ebdb6b6..c7cfde7 100644 --- a/server/gc/seafile-session.c +++ b/server/gc/seafile-session.c @@ -4,7 +4,6 @@ #include #include -#include #include #include "seafile-session.h" diff --git a/server/gc/seafserv-gc.c b/server/gc/seafserv-gc.c index 0a104da..951bec3 100644 --- a/server/gc/seafserv-gc.c +++ b/server/gc/seafserv-gc.c @@ -3,8 +3,6 @@ #include -#include - #include "seafile-session.h" #include "gc-core.h" #include "verify.h" diff --git a/server/index-blocks-mgr.c b/server/index-blocks-mgr.c index 6fa4847..9ee9820 100644 --- a/server/index-blocks-mgr.c +++ b/server/index-blocks-mgr.c @@ -7,8 +7,8 @@ #include #include -#include -#include +#include + #include "utils.h" #include "log.h" diff --git a/server/pack-dir.c b/server/pack-dir.c index 7763d18..5b3cd02 100644 --- a/server/pack-dir.c +++ b/server/pack-dir.c @@ -3,8 +3,6 @@ #define DEBUG_FLAG SEAFILE_DEBUG_HTTP #include "log.h" -#include - #include "seafile-object.h" #include "seafile-crypt.h" #include "seafile-error.h" diff --git a/server/passwd-mgr.c b/server/passwd-mgr.c index 729a035..fcf0c86 100644 --- a/server/passwd-mgr.c +++ b/server/passwd-mgr.c @@ -2,7 +2,7 @@ #include "log.h" #include -#include +#include #include "seafile-session.h" #include "seafile-object.h" diff --git a/server/permission-mgr.c b/server/permission-mgr.c index 05c871b..761d112 100644 --- a/server/permission-mgr.c +++ b/server/permission-mgr.c @@ -2,8 +2,6 @@ #include "common.h" -#include - #include "db.h" #include "seafile-session.h" #include "permission-mgr.h" diff --git a/server/quota-mgr.c b/server/quota-mgr.c index ef6687f..af4e626 100644 --- a/server/quota-mgr.c +++ b/server/quota-mgr.c @@ -5,9 +5,6 @@ #include "log.h" #include "utils.h" -#include -#include - #include "seafile-session.h" #include "seaf-db.h" #include "quota-mgr.h" diff --git a/server/repo-mgr.c b/server/repo-mgr.c index 3c1c1a9..d76b695 100644 --- a/server/repo-mgr.c +++ b/server/repo-mgr.c @@ -7,8 +7,7 @@ #include #include -#include -#include +#include #include "utils.h" #include "log.h" diff --git a/server/repo-op.c b/server/repo-op.c index 0d1fe50..b0aa0d8 100644 --- a/server/repo-op.c +++ b/server/repo-op.c @@ -7,8 +7,6 @@ #include #include -#include -#include #include "utils.h" #define DEBUG_FLAG SEAFILE_DEBUG_OTHER #include "log.h" diff --git a/server/repo-perm.c b/server/repo-perm.c index 74ca02f..33c60f9 100644 --- a/server/repo-perm.c +++ b/server/repo-perm.c @@ -2,8 +2,6 @@ #include "common.h" -#include -#include #include "utils.h" #include "log.h" diff --git a/server/seaf-server.c b/server/seaf-server.c index 3733914..f71bb4c 100644 --- a/server/seaf-server.c +++ b/server/seaf-server.c @@ -2,6 +2,12 @@ #include "common.h" +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#include +#else +#include +#endif + #include #include #include @@ -12,7 +18,6 @@ #include #include -#include #include #include diff --git a/server/seafile-session.h b/server/seafile-session.h index 5e8e603..ffdf913 100644 --- a/server/seafile-session.h +++ b/server/seafile-session.h @@ -3,9 +3,7 @@ #ifndef SEAFILE_SESSION_H #define SEAFILE_SESSION_H -#include -#include -#include +#include #include "block-mgr.h" #include "fs-mgr.h" diff --git a/server/share-mgr.c b/server/share-mgr.c index 8f72b41..ee463cd 100644 --- a/server/share-mgr.c +++ b/server/share-mgr.c @@ -11,7 +11,6 @@ #include "seaf-db.h" #include "log.h" #include "seafile-error.h" -#include SeafShareManager * seaf_share_manager_new (SeafileSession *seaf) diff --git a/server/size-sched.c b/server/size-sched.c index a3edeff..ad4b66c 100644 --- a/server/size-sched.c +++ b/server/size-sched.c @@ -1,6 +1,5 @@ #include "common.h" -#include #include #include "seafile-session.h" diff --git a/server/virtual-repo.c b/server/virtual-repo.c index 745dbf0..09978f0 100644 --- a/server/virtual-repo.c +++ b/server/virtual-repo.c @@ -7,8 +7,7 @@ #define DEBUG_FLAG SEAFILE_DEBUG_OTHER #include "log.h" -#include -#include +#include #include #include "seafile-session.h" diff --git a/server/web-accesstoken-mgr.c b/server/web-accesstoken-mgr.c index 08b27c0..93bcdb6 100644 --- a/server/web-accesstoken-mgr.c +++ b/server/web-accesstoken-mgr.c @@ -2,7 +2,7 @@ #include "common.h" -#include +#include #include diff --git a/server/zip-download-mgr.c b/server/zip-download-mgr.c index a7ec75f..62f6663 100644 --- a/server/zip-download-mgr.c +++ b/server/zip-download-mgr.c @@ -1,9 +1,8 @@ #include #include -#include - #include "common.h" +#include #include "utils.h" #include "log.h" #include "seafile-error.h"