MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / child_init

Function child_init

modules/cachedb_sql/cachedb_sql.c:563–584  ·  view source on GitHub ↗

* Initialize children */

Source from the content-addressed store, hash-verified

561 * Initialize children
562 */
563static int child_init(int rank)
564{
565 struct cachedb_url *it;
566 cachedb_con *con;
567
568 for (it = sql_script_urls;it;it=it->next) {
569 LM_DBG("iterating through conns - [%s]\n", db_url_escape(&it->url));
570 con = dbcache_init(&it->url);
571 if (con == NULL) {
572 LM_ERR("failed to open connection\n");
573 return -1;
574 }
575 if (cachedb_put_connection(&cache_mod_name,con) < 0) {
576 LM_ERR("failed to insert connection\n");
577 return -1;
578 }
579 }
580
581 cachedb_free_url(sql_script_urls);
582
583 return 0;
584}
585
586/*
587 * destroy function

Callers

nothing calls this directly

Calls 4

db_url_escapeFunction · 0.85
dbcache_initFunction · 0.85
cachedb_put_connectionFunction · 0.85
cachedb_free_urlFunction · 0.85

Tested by

no test coverage detected