提交 5208bffe authored 作者: Michael Jerris's avatar Michael Jerris

fix url parser from when I broke it trying to fix it, but now it's fixed.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3988 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 ed0524c2
...@@ -555,7 +555,7 @@ enum url_type_e url_get_type(char const *scheme, size_t len) ...@@ -555,7 +555,7 @@ enum url_type_e url_get_type(char const *scheme, size_t len)
static static
int _url_d(url_t *url, char *s) int _url_d(url_t *url, char *s)
{ {
size_t n; size_t n, p;
char *s0, rest_c, *host; char *s0, rest_c, *host;
int net_path = 1; int net_path = 1;
...@@ -592,7 +592,15 @@ int _url_d(url_t *url, char *s) ...@@ -592,7 +592,15 @@ int _url_d(url_t *url, char *s)
if (url->url_type == url_sip || url->url_type == url_sips) { if (url->url_type == url_sip || url->url_type == url_sips) {
/* SIP URL may have /; in user part */ /* SIP URL may have /; in user part */
n = strcspn(s, "@"); /* Opaque part */ #if 1
n = strcspn(s, "@#"); /* Opaque part */
if ((p = strcspn(s, "#")) == n) {
n = strcspn(s, "@");
if (s[n] != '@')
n = 0;
}
#else
n = strcspn(s, "@");/* Opaque part */
if (n == strlen(s)) { if (n == strlen(s)) {
if ((strchr(s, '#'))) if ((strchr(s, '#')))
n = 0; n = 0;
...@@ -600,6 +608,7 @@ int _url_d(url_t *url, char *s) ...@@ -600,6 +608,7 @@ int _url_d(url_t *url, char *s)
if (strchr(s + n, '#')) if (strchr(s + n, '#'))
n = 0; n = 0;
} }
#endif
n += strcspn(s + n, "/;?#"); n += strcspn(s + n, "/;?#");
} }
else if (url->url_type == url_wv) { else if (url->url_type == url_wv) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论