int cbparse_authmod_descr(void *pArg, const char *p) { int rc = 0; const char *p2 = NULL; const char *p3 = NULL; RTMP_AUTH_PARSE_CTXT_T *parseCtxt = (RTMP_AUTH_PARSE_CTXT_T *) pArg; if(!p || !parseCtxt) { return -1; } parseCtxt->index++; MOVE_WHILE_SPACE(p); MOVE_WHILE_CHAR(p, '['); MOVE_WHILE_SPACE(p); //LOG(X_DEBUG("cbparse_authmod_descr2: '%s' %d"), p, parseCtxt->index); if(parseCtxt->index == 1) { p2 = p; MOVE_UNTIL_CHAR(p2, ']'); if(strutil_safe_copyToBuf(parseCtxt->errorStr, sizeof(parseCtxt->errorStr), p, p2)) { avc_strip_nl(parseCtxt->errorStr, strlen(parseCtxt->errorStr), 1); } } else if(parseCtxt->index == 2) { if((p2 = strstr(p, "authmod="))) { p2+=8; p3 = p2; while(*p3 != '\0' && *p3 != ']' && *p3 != ' ' && *p3 != ';') { p3++; } strutil_safe_copyToBuf(parseCtxt->authmodStr, sizeof(parseCtxt->authmodStr), p2, p3); } } else if(parseCtxt->index == 3) { if(*p == '?') { p++; } rc = strutil_parse_delimeted_str(cbparse_authmod_descr_params, &parseCtxt->authList, p, '&'); } return rc; }
const char *strutil_skip_key(const char *p0, unsigned int len) { const char *p = p0; p += len; while(*p == ' ' || *p == '\t') { p++; } if(*p != '=') { LOG(X_ERROR("Invalid parse key element '%s'"), p0); return NULL; } while(*p == '=') { p++; } while(*p == ' ' || *p == '\t') { p++; } //TODO: ok.. this is bad avc_strip_nl((char *) p, strlen(p), 0); return p; }