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

Function mi_stat_name

statistics.c:655–682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

653}
654
655int mi_stat_name(str *mod, str *stat, str *out)
656{
657 static str tmp_buf = {0, 0};
658 char *tmp;
659
660 if (mod) {
661 tmp = pkg_realloc(tmp_buf.s, mod->len + stat->len + 1);
662 if (!tmp) {
663 LM_ERR("no more pkg memory\n");
664 return -1;
665 }
666 tmp_buf.s = tmp;
667
668 memcpy(tmp_buf.s, mod->s, mod->len);
669 tmp_buf.len = mod->len;
670 tmp_buf.s[tmp_buf.len++] = ':';
671
672 memcpy(tmp_buf.s + tmp_buf.len, stat->s, stat->len);
673 tmp_buf.len += stat->len;
674
675 out->len = tmp_buf.len;
676 out->s = tmp_buf.s;
677 } else {
678 out->len = stat->len;
679 out->s = stat->s;
680 }
681 return 0;
682}
683
684int mi_print_stat(mi_item_t *resp_obj, str *mod, str *stat, unsigned long val)
685{

Callers 2

mi_print_statFunction · 0.85
mi_list_statFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected