MCPcopy Create free account
hub / github.com/acl-dev/acl / probe_cfg_load

Function probe_cfg_load

lib_protocol/samples/http_probe/probe_cfg.cpp:285–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285void probe_cfg_load(void)
286{
287 const char *myname = "probe_cfg_load";
288 ACL_XINETD_CFG_PARSER *xcp;
289 const ACL_ARRAY *servers_array;
290 const char *ptr;
291
292 if (var_cfg_file == NULL || *var_cfg_file == 0)
293 acl_msg_fatal("%s(%d)->%s: __cfg_file null",
294 __FILE__, __LINE__, myname);
295
296 xcp = acl_xinetd_cfg_load(var_cfg_file);
297 if (xcp == NULL) {
298 acl_msg_error("%s(%d)->%s: xinetd_cfg_load return null, file=%s",
299 __FILE__, __LINE__, myname, var_cfg_file);
300 exit (1);
301 }
302 __cfg_parser = xcp;
303
304 var_probe_server_link = acl_array_create(50);
305 if (var_probe_server_link == NULL)
306 acl_msg_fatal("%s(%d)->%s: acl_array_create error, serr=%s",
307 __FILE__, __LINE__, myname, strerror(errno));
308
309 servers_array = acl_xinetd_cfg_get_ex(xcp, VAR_CFG_SERVER);
310 if (servers_array == NULL)
311 acl_msg_fatal("%s(%d)->%s: not fine %s line",
312 __FILE__, __LINE__, myname, VAR_CFG_SERVER);
313
314 __cfg_server_parse(servers_array);
315
316 var_probe_logfile = acl_xinetd_cfg_get(xcp, VAR_CFG_LOGFILE);
317 if (var_probe_logfile == NULL || *var_probe_logfile == 0)
318 acl_msg_warn("%s(%d)->%s: null var_probe_logfile",
319 __FILE__, __LINE__, myname);
320 ptr = acl_xinetd_cfg_get(xcp, VAR_CFG_LOGLEVEL);
321 if (ptr && *ptr)
322 var_probe_loglevel = atoi(ptr);
323 if (var_probe_loglevel < 0)
324 var_probe_loglevel = 0;
325 ptr = acl_xinetd_cfg_get(xcp, VAR_CFG_STATLEN);
326 if (ptr && *ptr)
327 var_probe_statlen = atoi(ptr);
328 if (var_probe_statlen <= 0)
329 var_probe_statlen = 1024;
330
331 ptr = acl_xinetd_cfg_get(xcp, VAR_CFG_FORK_SLEEP);
332 if (ptr && *ptr)
333 var_probe_fork_sleep = atoi(ptr);
334 if (var_probe_fork_sleep < 0)
335 var_probe_fork_sleep = 1;
336
337 ptr = acl_xinetd_cfg_get(xcp, VAR_CFG_DEBUG_FILE);
338 if (ptr && *ptr)
339 var_probe_debug_fp = acl_vstream_fopen(ptr,
340 O_WRONLY | O_CREAT | O_APPEND, 0600, 4096);
341 else
342 var_probe_debug_fp = NULL;

Callers 1

initFunction · 0.85

Calls 9

acl_msg_fatalFunction · 0.85
acl_xinetd_cfg_loadFunction · 0.85
acl_msg_errorFunction · 0.85
acl_array_createFunction · 0.85
acl_xinetd_cfg_get_exFunction · 0.85
__cfg_server_parseFunction · 0.85
acl_xinetd_cfg_getFunction · 0.85
acl_msg_warnFunction · 0.85
acl_vstream_fopenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…