Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: add custom function to check emergency URN #6

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions src/core/parser/parse_uri.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,28 +237,30 @@ int parse_uri(char *buf, int len, struct sip_uri *uri)
} else \
goto error_bad_char

#define check_host_end \
case ':': \
/* found the host */ \
uri->host.s = s; \
uri->host.len = p - s; \
state = URI_PORT; \
s = p + 1; \
break; \
case ';': \
uri->host.s = s; \
uri->host.len = p - s; \
state = URI_PARAM; \
s = p + 1; \
break; \
case '?': \
uri->host.s = s; \
uri->host.len = p - s; \
state = URI_HEADERS; \
s = p + 1; \
break; \
case '&': \
case '@': \
#define check_host_end \
case ':': \
/* found the host */ \
if(scheme != URN_SCH) { \
uri->host.s = s; \
uri->host.len = p - s; \
IvanRibakov marked this conversation as resolved.
Show resolved Hide resolved
state = URI_PORT; \
s = p + 1; \
} \
break; \
case ';': \
uri->host.s = s; \
uri->host.len = p - s; \
state = URI_PARAM; \
s = p + 1; \
break; \
case '?': \
uri->host.s = s; \
uri->host.len = p - s; \
state = URI_HEADERS; \
s = p + 1; \
break; \
case '&': \
case '@': \
goto error_bad_char


Expand Down Expand Up @@ -493,7 +495,7 @@ int parse_uri(char *buf, int len, struct sip_uri *uri)
case '@': /* error no user part, or
* be forgiving and accept it ? */
default:
state = URI_USER;
state = (scheme == URN_SCH) ? URI_HOST : URI_USER;
}
break;
case URI_USER:
Expand Down
Loading