* Search the pool for a connection with * the identifier equal to id, NULL is returned * when no connection is found */
| 38 | * when no connection is found |
| 39 | */ |
| 40 | struct pool_con* pool_get(const struct db_id* id) |
| 41 | { |
| 42 | struct pool_con* ptr; |
| 43 | |
| 44 | if (!id) { |
| 45 | LM_ERR("invalid parameter value\n"); |
| 46 | return 0; |
| 47 | } |
| 48 | |
| 49 | ptr = db_pool; |
| 50 | while (ptr) { |
| 51 | if (cmp_db_id(id, ptr->id)) { |
| 52 | ptr->ref++; |
| 53 | return ptr; |
| 54 | } |
| 55 | ptr = ptr->next; |
| 56 | } |
| 57 | |
| 58 | return 0; |
| 59 | } |
| 60 | |
| 61 | |
| 62 | /* |
no test coverage detected