Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belle-sip
Commits
a1465c96
Commit
a1465c96
authored
Feb 11, 2014
by
jehan
Browse files
avoid to create an extended header in case of a parsing error for a known header
parent
309a1733
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/grammars/belle_sip_message.g
View file @
a1465c96
...
...
@@ -1328,11 +1328,11 @@ header returns [belle_sip_header_t* ret=NULL]
//********************************************************************************************//
header_extension_base[ANTLR3_BOOLEAN is_http] returns [belle_sip_header_t* ret]
scope {int as_value;}
@init {$ret=NULL;}
@init {$
header_extension_base::as_value=0;$
ret=NULL;}
: (header_name
hcolon /*sp_tab_colon*/ /*because LWS can be in both colon or header_value*/
(header_value[(const char*)$header_name.text->chars,$is_http ]{$ret=$header_value.ret;})?) {
if (!$ret
) {
(header_value[(const char*)$header_name.text->chars,$is_http ]{$
header_extension_base::as_value=1;$
ret=$header_value.ret;})?) {
if (!$ret
&& !$header_extension_base::as_value) { /*to handle value parsing error*/
/*special case: header without value*/
$ret=belle_sip_header_create((const char*)$header_name.text->chars,NULL);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment