src/server/daemon/config.c

changeset 443
ef3c8a0e1fee
parent 440
d77b8f3e14e2
child 444
96d2ba2f28db
equal deleted inserted replaced
442:05c2b62448b1 443:ef3c8a0e1fee
183 CxList *list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("Runtime")); 183 CxList *list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("Runtime"));
184 CxIterator iter = cxListIterator(list, 0); 184 CxIterator iter = cxListIterator(list, 0);
185 cx_foreach(ConfigNode *, runtimeobj, iter) { 185 cx_foreach(ConfigNode *, runtimeobj, iter) {
186 if(cfg_handle_runtime(serverconfig, runtimeobj)) { 186 if(cfg_handle_runtime(serverconfig, runtimeobj)) {
187 // error 187 // error
188 log_ereport(LOG_FAILURE, "server.conf runtime");
188 return NULL; 189 return NULL;
189 } 190 }
190 } 191 }
191 cxListDestroy(list); 192 cxListDestroy(list);
192 193
194 log_ereport(LOG_DEBUG, "apply config: Threadpool"); 195 log_ereport(LOG_DEBUG, "apply config: Threadpool");
195 list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("Threadpool")); 196 list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("Threadpool"));
196 iter = cxListIterator(list, 0); 197 iter = cxListIterator(list, 0);
197 cx_foreach(ConfigNode *, elm, iter) { 198 cx_foreach(ConfigNode *, elm, iter) {
198 if(cfg_handle_threadpool(serverconfig, elm)) { 199 if(cfg_handle_threadpool(serverconfig, elm)) {
200 log_ereport(LOG_FAILURE, "server.conf threadpool");
199 return NULL; 201 return NULL;
200 } 202 }
201 } 203 }
202 cxListDestroy(list); 204 cxListDestroy(list);
203 // check thread pool config 205 // check thread pool config
210 log_ereport(LOG_DEBUG, "apply config: EventHandler"); 212 log_ereport(LOG_DEBUG, "apply config: EventHandler");
211 list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("EventHandler")); 213 list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("EventHandler"));
212 iter = cxListIterator(list, 0); 214 iter = cxListIterator(list, 0);
213 cx_foreach(ConfigNode *, elm, iter) { 215 cx_foreach(ConfigNode *, elm, iter) {
214 if(cfg_handle_eventhandler(serverconfig, elm)) { 216 if(cfg_handle_eventhandler(serverconfig, elm)) {
215 // error 217 // error
218 log_ereport(LOG_FAILURE, "cannot create event handler");
216 return NULL; 219 return NULL;
217 } 220 }
218 } 221 }
219 // check event handler config 222 // check event handler config
220 if(check_event_handler_cfg() != 0) { 223 if(check_event_handler_cfg() != 0) {
221 /* critical error */ 224 /* critical error */
222 return NULL; 225 return NULL;
223 } 226 }
224 cxListDestroy(list); 227 cxListDestroy(list);
225 228
226 // load Listener config 229 // load Listener config
227 log_ereport(LOG_DEBUG, "apply config: Listener"); 230 log_ereport(LOG_DEBUG, "apply config: Listener");
228 list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("Listener")); 231 list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("Listener"));
229 iter = cxListIterator(list, 0); 232 iter = cxListIterator(list, 0);
230 cx_foreach(ConfigNode *, scfgobj, iter) { 233 cx_foreach(ConfigNode *, scfgobj, iter) {

mercurial