| 261 | } |
| 262 | |
| 263 | cachedb_con *cachedb_get_connection(cachedb_engine *cde,str *group_name) |
| 264 | { |
| 265 | cachedb_con_list *ret; |
| 266 | |
| 267 | if (cde == NULL) { |
| 268 | LM_ERR("no such cachedb engine\n"); |
| 269 | return 0; |
| 270 | } |
| 271 | |
| 272 | if (group_name == NULL || group_name->s == NULL || group_name->len == 0) |
| 273 | return cde->default_connection; |
| 274 | else { |
| 275 | for (ret=cde->connections;ret;ret=ret->next) { |
| 276 | if (ret->grp.len == group_name->len && |
| 277 | memcmp(ret->grp.s,group_name->s,group_name->len) == 0) |
| 278 | return ret->connection; |
| 279 | } |
| 280 | return NULL; |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | void cachedb_end_connections(str *cachedb_name) |
| 285 | { |
no outgoing calls