48 #include "config.h" |
48 #include "config.h" |
49 #include "configmanager.h" |
49 #include "configmanager.h" |
50 #include "httplistener.h" |
50 #include "httplistener.h" |
51 #include "webserver.h" |
51 #include "webserver.h" |
52 #include "log.h" |
52 #include "log.h" |
53 |
53 #include "auth.h" |
54 |
54 |
55 extern struct FuncStruct webserver_funcs[]; |
55 extern struct FuncStruct webserver_funcs[]; |
56 |
56 |
57 |
57 |
58 int webserver_init() { |
58 int webserver_init() { |
72 init_configuration_manager(); |
72 init_configuration_manager(); |
73 if(cfgmgr_load_config() != 0) { |
73 if(cfgmgr_load_config() != 0) { |
74 fprintf(stderr, "Cannot load configuration\n"); |
74 fprintf(stderr, "Cannot load configuration\n"); |
75 return -1; |
75 return -1; |
76 } |
76 } |
|
77 |
|
78 // init caches |
|
79 auth_cache_init(); |
77 |
80 |
78 // create tmp dir and pid file |
81 // create tmp dir and pid file |
79 ServerConfiguration *cfg = cfgmgr_get_server_config(); |
82 ServerConfiguration *cfg = cfgmgr_get_server_config(); |
80 char *mkdir_cmd = NULL; |
83 char *mkdir_cmd = NULL; |
81 asprintf(&mkdir_cmd, "mkdir -p %s", cfg->tmp.ptr); |
84 asprintf(&mkdir_cmd, "mkdir -p %s", cfg->tmp.ptr); |