summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsip/sip_parser.h
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-07-17 10:04:12 +0000
committerBenny Prijono <bennylp@teluu.com>2006-07-17 10:04:12 +0000
commit7e998fa0ffc4fdfeb742ccd907a4b443ef79293d (patch)
tree1eacf47d6c8b6cf98d30da9be717bba73ae128d2 /pjsip/include/pjsip/sip_parser.h
parent6244290e262fa290196b1ef2f1cec16fd193382e (diff)
Fixed bugs with the parsing (re: allowable chars): (1) Parameters in URI and header should have different spec. URI should use paramchar spec while header should use token spec (thanks Jeroen van Bemmel) (2) The same rule applies when escaping the parameters during printing process (3) While we're on it, also fixed the tel-URI parser to automatically unescape the parameter values.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@606 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsip/sip_parser.h')
-rw-r--r--pjsip/include/pjsip/sip_parser.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/pjsip/include/pjsip/sip_parser.h b/pjsip/include/pjsip/sip_parser.h
index 54dd52df..fe788395 100644
--- a/pjsip/include/pjsip/sip_parser.h
+++ b/pjsip/include/pjsip/sip_parser.h
@@ -314,7 +314,7 @@ extern pj_cis_t
pjsip_TOKEN_SPEC, /**< Token. */
pjsip_HEX_SPEC, /**< Hexadecimal digits. */
pjsip_PARAM_CHAR_SPEC, /**< For scanning pname (or pvalue when it's
- not quoted.) */
+ not quoted.) in URI */
pjsip_PARAM_CHAR_SPEC_ESC, /**< Variant without the escape ('%') char */
pjsip_HDR_CHAR_SPEC, /**< Chars in hname/havalue in URL. */
pjsip_HDR_CHAR_SPEC_ESC, /**< Variant without the escape ('%') char */
@@ -356,11 +356,17 @@ enum
PJSIP_PARSE_REMOVE_QUOTE = 1,
};
+/* Parse parameter in header (matching the character as token) */
void pjsip_parse_param_imp( pj_scanner *scanner, pj_pool_t *pool,
pj_str_t *pname, pj_str_t *pvalue,
unsigned opt);
+/* Parse parameter in URL (matching the character as paramchar) */
+void pjsip_parse_uri_param_imp( pj_scanner *scanner, pj_pool_t *pool,
+ pj_str_t *pname, pj_str_t *pvalue,
+ unsigned opt);
void pjsip_concat_param_imp( pj_str_t *param, pj_pool_t *pool,
- const pj_str_t *pname, const pj_str_t *pvalue, int sepchar);
+ const pj_str_t *pname, const pj_str_t *pvalue,
+ int sepchar);
void pjsip_parse_end_hdr_imp ( pj_scanner *scanner );
PJ_END_DECL