MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / fixup_db_id

Function fixup_db_id

modules/sqlops/sqlops.c:631–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629}
630
631static 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
659static int fixup_db_id_sync(void** param)
660{

Callers 2

fixup_db_id_syncFunction · 0.85
fixup_db_id_asyncFunction · 0.85

Calls 1

id2db_urlFunction · 0.85

Tested by

no test coverage detected