src/server/daemon/webserver.c

changeset 66
74babc0082b7
parent 63
66442f81f823
child 68
f5102a892ed4
equal deleted inserted replaced
65:14722c5f8856 66:74babc0082b7
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);
138 } else if(vars->Vuserpw) { 141 } else if(vars->Vuserpw) {
139 log_ereport( 142 log_ereport(
140 LOG_WARN, 143 LOG_WARN,
141 "server must be started as root to change uid"); 144 "server must be started as root to change uid");
142 } 145 }
143 146
144 return 0; 147 return 0;
145 } 148 }
146 149
147 int webserver_run() { 150 int webserver_run() {
148 printf("webserver_run\n"); 151 printf("webserver_run\n");

mercurial