| 2254 | |
| 2255 | |
| 2256 | static int db_connect_head(struct head_db *x) { |
| 2257 | |
| 2258 | if( *(x->db_con) ) { |
| 2259 | LM_INFO("db_con already present\n"); |
| 2260 | return 1; |
| 2261 | } |
| 2262 | if( x->db_url.s && (*(x->db_con) = x->db_funcs.init(&(x->db_url)))==0 ) { |
| 2263 | LM_ERR("cannot initialize database connection" |
| 2264 | "(partition:%.*s, db_url:%.*s, len:%d)\n", x->partition.len, |
| 2265 | x->partition.s, x->db_url.len, x->db_url.s, x->db_url.len); |
| 2266 | return -1; |
| 2267 | } |
| 2268 | return 0; |
| 2269 | } |
| 2270 | |
| 2271 | |
| 2272 | /* simple wrapper over dr_reload_data to make it compatible with ipc_rpc_f, |
no outgoing calls
no test coverage detected