osip_uri.c (libosip2-5.2.0) | : | osip_uri.c (libosip2-5.2.1) | ||
---|---|---|---|---|
skipping to change at line 378 | skipping to change at line 378 | |||
return NULL; | return NULL; | |||
return url->port; | return url->port; | |||
} | } | |||
int osip_uri_parse_headers(osip_uri_t *url, const char *headers) { | int osip_uri_parse_headers(osip_uri_t *url, const char *headers) { | |||
int i; | int i; | |||
const char *_and; | const char *_and; | |||
const char *equal; | const char *equal; | |||
if (headers[0] != '?') /* This API can only be used with a starting '?' char * | ||||
/ | ||||
return OSIP_SYNTAXERROR; | ||||
/* find '=' wich is the separator for one header */ | /* find '=' wich is the separator for one header */ | |||
/* find ';' wich is the separator for multiple headers */ | /* find ';' wich is the separator for multiple headers */ | |||
equal = strchr(headers, '='); | equal = strchr(headers, '='); | |||
_and = strchr(headers + 1, '&'); | _and = strchr(headers + 1, '&'); | |||
if (equal == NULL) /* each header MUST have a value */ | if (equal == NULL) /* each header MUST have a value */ | |||
return OSIP_SYNTAXERROR; | return OSIP_SYNTAXERROR; | |||
do { | do { | |||
skipping to change at line 465 | skipping to change at line 468 | |||
} | } | |||
int osip_uri_parse_params(osip_uri_t *url, const char *params) { | int osip_uri_parse_params(osip_uri_t *url, const char *params) { | |||
int i; | int i; | |||
char *pname; | char *pname; | |||
char *pvalue; | char *pvalue; | |||
const char *comma; | const char *comma; | |||
const char *equal; | const char *equal; | |||
if (params[0] != ';') /* This API can only be used with a starting '?' char */ | ||||
return OSIP_SYNTAXERROR; | ||||
/* find '=' wich is the separator for one param */ | /* find '=' wich is the separator for one param */ | |||
/* find ';' wich is the separator for multiple params */ | /* find ';' wich is the separator for multiple params */ | |||
equal = next_separator(params + 1, '=', ';'); | equal = next_separator(params + 1, '=', ';'); | |||
comma = strchr(params + 1, ';'); | comma = strchr(params + 1, ';'); | |||
while (comma != NULL) { | while (comma != NULL) { | |||
if (equal == NULL) { | if (equal == NULL) { | |||
equal = comma; | equal = comma; | |||
pvalue = NULL; | pvalue = NULL; | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 7 lines changed or added |