static int child_init(int rank) { if(db_url.s && acc_db_init_child(&db_url)<0) { LM_ERR("could not open database connection"); return -1; } /* DIAMETER */ #ifdef DIAM_ACC /* open TCP connection */ LM_DBG("initializing TCP connection\n"); sockfd = init_mytcp(diameter_client_host, diameter_client_port); if(sockfd==-1) { LM_ERR("TCP connection not established\n"); return -1; } LM_DBG("a TCP connection was established on sockfd=%d\n", sockfd); /* every child with its buffer */ rb = (rd_buf_t*)pkg_malloc(sizeof(rd_buf_t)); if(!rb) { LM_DBG("no more pkg memory\n"); return -1; } rb->buf = 0; #endif return 0; }
static int child_init(int rank) { if(db_url.s && acc_db_init_child(&db_url)<0) { LM_ERR("could not open database connection"); return -1; } return 0; }
static int mod_lrt_init( void ) { #ifdef SQL_ACC if(db_url.s && acc_db_init_child(&db_url)<0) { LM_ERR("could not open database connection"); return -1; } #endif return 0; }