Changeset 1610 for pjproject/trunk/pjsip/src/pjsip/sip_parser.c
- Timestamp:
- Dec 2, 2007 3:40:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_parser.c
r1566 r1610 1078 1078 pvalue->slen -= 2; 1079 1079 } 1080 } else if (*scanner->curptr == '[') { 1081 /* pvalue can be a quoted IPv6; in this case, the 1082 * '[' and ']' quote characters are to be removed 1083 * from the pvalue. 1084 */ 1085 pj_scan_get_char(scanner); 1086 pj_scan_get_until_ch(scanner, ']', pvalue); 1087 pj_scan_get_char(scanner); 1080 1088 } else if(pj_cis_match(spec, *scanner->curptr)) { 1081 1089 parser_get_and_unescape(scanner, pool, spec, esc_spec, pvalue); … … 1158 1166 } 1159 1167 1168 /* Parse host part: 1169 * host = hostname / IPv4address / IPv6reference 1170 */ 1171 static void int_parse_host(pj_scanner *scanner, pj_str_t *host) 1172 { 1173 if (*scanner->curptr == '[') { 1174 /* Note: the '[' and ']' characters are removed from the host */ 1175 pj_scan_get_char(scanner); 1176 pj_scan_get_until_ch(scanner, ']', host); 1177 pj_scan_get_char(scanner); 1178 } else { 1179 pj_scan_get( scanner, &pconst.pjsip_HOST_SPEC, host); 1180 } 1181 } 1182 1160 1183 /* Parse host:port in URI. */ 1161 1184 static void int_parse_uri_host_port( pj_scanner *scanner, 1162 1185 pj_str_t *host, int *p_port) 1163 1186 { 1164 pj_scan_get( scanner, &pconst.pjsip_HOST_SPEC, host); 1187 int_parse_host(scanner, host); 1188 1165 1189 /* RFC3261 section 19.1.2: host don't need to be unescaped */ 1166 1190 if (*scanner->curptr == ':') { … … 1843 1867 pj_str_t pname, pvalue; 1844 1868 1845 int_parse_param( scanner, pool, &pname, &pvalue, 0); 1869 //Parse with PARAM_CHAR instead, to allow IPv6 1870 //int_parse_param( scanner, pool, &pname, &pvalue, 0); 1871 /* Get ';' character */ 1872 pj_scan_get_char(scanner); 1873 1874 parse_param_imp(scanner, pool, &pname, &pvalue, 1875 &pconst.pjsip_PARAM_CHAR_SPEC, 1876 &pconst.pjsip_PARAM_CHAR_SPEC_ESC, 0); 1846 1877 1847 1878 if (!parser_stricmp(pname, pconst.pjsip_BRANCH_STR) && pvalue.slen) { … … 1984 2015 1985 2016 pj_scan_get( scanner, &pconst.pjsip_TOKEN_SPEC, &hdr->transport); 1986 pj_scan_get( scanner, &pconst.pjsip_HOST_SPEC, &hdr->sent_by.host);2017 int_parse_host(scanner, &hdr->sent_by.host); 1987 2018 1988 2019 if (*scanner->curptr==':') {
Note: See TracChangeset
for help on using the changeset viewer.