From 31d42235239a1291a599b84cc352b7b5b53448b7 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 3 Jul 2006 22:08:47 +0000 Subject: Various performance improvements in PJSIP: (1) optimizing for common case to minimize stricmp() calls (header names, method, URI schemes), (2) added functionality in scanner to parse and unescape in-place, (3) etc.. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@583 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/include/pjsip/sip_config.h | 17 +++++++++++++++++ pjsip/include/pjsip/sip_parser.h | 4 ++++ 2 files changed, 21 insertions(+) (limited to 'pjsip/include') diff --git a/pjsip/include/pjsip/sip_config.h b/pjsip/include/pjsip/sip_config.h index 535f6697..2d635d62 100644 --- a/pjsip/include/pjsip/sip_config.h +++ b/pjsip/include/pjsip/sip_config.h @@ -130,6 +130,23 @@ #endif +/** + * If non-zero, SIP parser will unescape the escape characters ('%') + * in the original message, which means that it will modify the + * original message. Otherwise the parser will create a copy of + * the string and store the unescaped string to the new location. + * + * Unescaping in-place is faster, but less elegant (and it may + * break certain applications). So normally it's disabled, unless + * when benchmarking (to show off big performance). + * + * Default: 0 + */ +#ifndef PJSIP_UNESCAPE_IN_PLACE +# define PJSIP_UNESCAPE_IN_PLACE 0 +#endif + + /* Endpoint. */ #define PJSIP_MAX_TIMER_COUNT (2*PJSIP_MAX_TSX_COUNT + 2*PJSIP_MAX_DIALOG_COUNT) diff --git a/pjsip/include/pjsip/sip_parser.h b/pjsip/include/pjsip/sip_parser.h index b9e752f0..54dd52df 100644 --- a/pjsip/include/pjsip/sip_parser.h +++ b/pjsip/include/pjsip/sip_parser.h @@ -315,10 +315,14 @@ extern pj_cis_t pjsip_HEX_SPEC, /**< Hexadecimal digits. */ pjsip_PARAM_CHAR_SPEC, /**< For scanning pname (or pvalue when it's not quoted.) */ + 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 */ pjsip_PROBE_USER_HOST_SPEC, /**< Hostname characters. */ pjsip_PASSWD_SPEC, /**< Password. */ + pjsip_PASSWD_SPEC_ESC, /**< Variant without the escape ('%') char */ pjsip_USER_SPEC, /**< User */ + pjsip_USER_SPEC_ESC, /**< Variant without the escape ('%') char */ pjsip_NOT_NEWLINE, /**< For eating up header, basicly any chars except newlines or zero. */ pjsip_NOT_COMMA_OR_NEWLINE, /**< Array elements. */ -- cgit v1.2.3