Skip to content

Commit

Permalink
uid_auth_db: removed history, updated log macros
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Sep 11, 2017
1 parent 6fa1e72 commit 6eb9f46
Show file tree
Hide file tree
Showing 5 changed files with 241 additions and 246 deletions.
14 changes: 6 additions & 8 deletions src/modules/uid_auth_db/aaa_avps.h
Expand Up @@ -39,8 +39,8 @@
* Parse list of tokens separated by some char and put each token
* into result array. Caller frees result array!
*/
static inline int
parse_token_list(char *p, char *pend, char separator, str **result)
static inline int parse_token_list(char *p, char *pend, char separator,
str **result)
{
int i;

Expand All @@ -63,29 +63,27 @@ parse_token_list(char *p, char *pend, char separator, str **result)
* Parse the list of AVP names separated by '|' into an array
* of names, each element of the array is str string
*/
static int
aaa_avps_init(str *avp_list, str **parsed_avps, int *avps_n)
static int aaa_avps_init(str *avp_list, str **parsed_avps, int *avps_n)
{
int errcode, i;
char *cp;

if (!avp_list->s || !avp_list->len) {
/* AVPs disabled, nothing to do */
/* AVPs disabled, nothing to do */
*avps_n = 0;
return 1;
}

cp = pkg_malloc(avp_list->len + 1);
if (cp == NULL) {
LOG(L_ERR, "aaa_avps::aaa_avps_init(): can't allocate memory\n");
LM_ERR("can't allocate memory\n");
errcode = -1;
goto bad;
}
memcpy(cp, avp_list->s, avp_list->len);
*avps_n = parse_token_list(cp, cp + avp_list->len, '|', parsed_avps);
if (*avps_n == -1) {
LOG(L_ERR, "aaa_avps::aaa_avps_init(): can't parse avps_column_int "
"parameter\n");
LM_ERR("can't parse avps_column_int parameter\n");
errcode = -2;
pkg_free(cp);
goto bad;
Expand Down

0 comments on commit 6eb9f46

Please sign in to comment.