src/server/daemon/config.c

changeset 46
636e05eb48f6
parent 45
a24aa388f02f
child 51
b28cf69f42e8
equal deleted inserted replaced
45:a24aa388f02f 46:636e05eb48f6
111 111
112 ServerConfig *serverconf = load_server_config(file); 112 ServerConfig *serverconf = load_server_config(file);
113 if(serverconf == NULL) { 113 if(serverconf == NULL) {
114 fprintf(stderr, "Cannot load server.conf\n"); 114 fprintf(stderr, "Cannot load server.conf\n");
115 } 115 }
116 ServerConfiguration *serverconfig = malloc(sizeof(ServerConfiguration)); 116 ServerConfiguration *serverconfig = calloc(1, sizeof(ServerConfiguration));
117 serverconfig->ref = 1; 117 serverconfig->ref = 1;
118 serverconfig->pool = pool_create(); 118 serverconfig->pool = pool_create();
119 serverconfig->listeners = NULL; 119 serverconfig->listeners = NULL;
120 serverconfig->host_vs = ucx_map_new(16); 120 serverconfig->host_vs = ucx_map_new(16);
121 serverconfig->authdbs = ucx_map_new(16); 121 serverconfig->authdbs = ucx_map_new(16);
151 } 151 }
152 } else { 152 } else {
153 /* horrible error */ 153 /* horrible error */
154 return NULL; 154 return NULL;
155 } 155 }
156 156
157 UcxList *list = ucx_map_sstr_get(serverconf->objects, sstrn("Runtime", 7)); 157 UcxList *list = ucx_map_sstr_get(serverconf->objects, sstrn("Runtime", 7));
158 UCX_FOREACH(UcxList*, list, elm) { 158 UCX_FOREACH(UcxList*, list, elm) {
159 ServerConfigObject *scfgobj = elm->data; 159 ServerConfigObject *scfgobj = elm->data;
160 cfg_handle_runtime(serverconfig, scfgobj); 160 cfg_handle_runtime(serverconfig, scfgobj);
161 } 161 }

mercurial