[Freeswitch-svn] [commit] r3988 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url
Author: mikej Date: Thu Jan 18 19:28:21 2007 New Revision: 3988 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.c Log: fix url parser from when I broke it trying to fix it, but now it's fixed. Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/url/url.c Thu Jan 18 19:28:21 2007 @@ -555,7 +555,7 @@ static int _url_d(url_t *url, char *s) { - size_t n; + size_t n, p; char *s0, rest_c, *host; int net_path = 1; @@ -592,14 +592,23 @@ if (url->url_type == url_sip || url->url_type == url_sips) { /* SIP URL may have /; in user part */ - n = strcspn(s, "@"); /* Opaque part */ - if (n == strlen(s)) { - if ((strchr(s, '#'))) - n = 0; - } else { - if (strchr(s + n, '#')) - n = 0; - } +#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 ((strchr(s, '#'))) + n = 0; + } else { + if (strchr(s + n, '#')) + n = 0; + } +#endif n += strcspn(s + n, "/;?#"); } else if (url->url_type == url_wv) {
participants (1)
-
Freeswitch SVN