| 629 | } |
| 630 | |
| 631 | static inline int fixup_db_id(void** param, int is_async) |
| 632 | { |
| 633 | struct db_url_container *db_id; |
| 634 | |
| 635 | if (!default_db_url) { |
| 636 | LM_ERR("no db url defined to be used by this function\n"); |
| 637 | return E_CFG; |
| 638 | } |
| 639 | |
| 640 | if (*param == NULL) |
| 641 | return 0; |
| 642 | |
| 643 | db_id=pkg_malloc(sizeof(struct db_url_container)); |
| 644 | if (db_id==NULL) { |
| 645 | LM_ERR("no more pkg!\n"); |
| 646 | return -1; |
| 647 | } |
| 648 | |
| 649 | if (id2db_url(*(int *)*param, 1, is_async, &db_id->u.url) < 0) { |
| 650 | LM_ERR("failed to get db url!\n"); |
| 651 | pkg_free(db_id); |
| 652 | return -1; |
| 653 | } |
| 654 | |
| 655 | *param = db_id; |
| 656 | return 0; |
| 657 | } |
| 658 | |
| 659 | static int fixup_db_id_sync(void** param) |
| 660 | { |
no test coverage detected