bf96d3d2160b8f2a356567d522127a26639d2b69
[feed/telephony.git] / libs / pjproject / patches / 0040-brackets-in-via-received-params.patch
1 From 6324760c2fb0ffeb2e29c6c0a96a33906caa8d5f Mon Sep 17 00:00:00 2001
2 From: Sean Bright <sean.bright@gmail.com>
3 Date: Thu, 16 Jan 2020 10:46:11 -0500
4 Subject: [PATCH] sip_parser.c: Allow brackets in via parameters
5
6 From RFC 5118 section 4.5:
7
8 While it would be beneficial if the same non-terminal
9 ("IPv6reference") was used for both the "sent-by" and "via-received"
10 production rules, there has not been a consensus in the working group
11 to that effect. Thus, the best that can be suggested is that
12 implementations must follow the Robustness Principle [RFC1122] and be
13 liberal in accepting a "received" parameter with or without the
14 delimiting "[" and "]" tokens. When sending a request,
15 implementations must not put the delimiting "[" and "]" tokens.
16 ---
17 pjsip/src/pjsip/sip_parser.c | 4 ++--
18 1 file changed, 2 insertions(+), 2 deletions(-)
19
20 diff --git a/pjsip/src/pjsip/sip_parser.c b/pjsip/src/pjsip/sip_parser.c
21 index e01e672fb..4f9c7fca4 100644
22 --- a/pjsip/src/pjsip/sip_parser.c
23 +++ b/pjsip/src/pjsip/sip_parser.c
24 @@ -384,11 +384,11 @@ static pj_status_t init_parser()
25
26 status = pj_cis_dup(&pconst.pjsip_VIA_PARAM_SPEC, &pconst.pjsip_TOKEN_SPEC);
27 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
28 - pj_cis_add_str(&pconst.pjsip_VIA_PARAM_SPEC, ":");
29 + pj_cis_add_str(&pconst.pjsip_VIA_PARAM_SPEC, "[:]");
30
31 status = pj_cis_dup(&pconst.pjsip_VIA_PARAM_SPEC_ESC, &pconst.pjsip_TOKEN_SPEC_ESC);
32 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
33 - pj_cis_add_str(&pconst.pjsip_VIA_PARAM_SPEC_ESC, ":");
34 + pj_cis_add_str(&pconst.pjsip_VIA_PARAM_SPEC_ESC, "[:]");
35
36 status = pj_cis_dup(&pconst.pjsip_HOST_SPEC, &pconst.pjsip_ALNUM_SPEC);
37 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
38 --
39 2.20.1
40