mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-27 12:14:32 +00:00
Tue Feb 24 07:33:35 CST 2009 Pekka Pessi <first.last@nokia.com>
* sip_parser.c: fixed sip_transport_d() Ignore-this: c14408145a269c25d00dcb20ab2391f6 sip_transport_d() was expected to canonize casing of well-known transports. Thanks for Adrian Gschwend for reporting the problem. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12261 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
46c3eec39a
commit
be15ed423f
@ -1 +1 @@
|
|||||||
Tue Feb 24 08:43:18 CST 2009
|
Tue Feb 24 08:44:37 CST 2009
|
||||||
|
@ -460,7 +460,8 @@ issize_t sip_transport_d(char **ss, char const **ttransport)
|
|||||||
char *s = *ss;
|
char *s = *ss;
|
||||||
|
|
||||||
#define TRANSPORT_MATCH(t) \
|
#define TRANSPORT_MATCH(t) \
|
||||||
(su_casenmatch(s + 7, t + 7, (sizeof t) - 8) && (IS_LWS(s[sizeof(t)])) \
|
(su_casenmatch(s + 7, t + 7, (sizeof t) - 8) && \
|
||||||
|
(!s[sizeof(t) - 1] || IS_LWS(s[sizeof(t) - 1])) \
|
||||||
&& (transport = t, s += sizeof(t) - 1))
|
&& (transport = t, s += sizeof(t) - 1))
|
||||||
|
|
||||||
if (!su_casenmatch(s, "SIP/2.0", 7) ||
|
if (!su_casenmatch(s, "SIP/2.0", 7) ||
|
||||||
|
@ -710,6 +710,31 @@ int test_basic(void)
|
|||||||
su_free(home, v), su_free(home, s);
|
su_free(home, v), su_free(home, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
char *input;
|
||||||
|
char const *output = NULL;
|
||||||
|
char udp[] = "sip/2.0/udp";
|
||||||
|
char tcp[] = "sip/2.0/tCp ";
|
||||||
|
char sctp[] = "sip/2.0/sctp\t";
|
||||||
|
char tls[] = "sip/2.0/tls\r";
|
||||||
|
|
||||||
|
input = udp;
|
||||||
|
TEST(sip_transport_d(&input, &output), 0);
|
||||||
|
TEST_S(output, "SIP/2.0/UDP");
|
||||||
|
|
||||||
|
input = tcp;
|
||||||
|
TEST(sip_transport_d(&input, &output), 0);
|
||||||
|
TEST_S(output, "SIP/2.0/TCP");
|
||||||
|
|
||||||
|
input = sctp;
|
||||||
|
TEST(sip_transport_d(&input, &output), 0);
|
||||||
|
TEST_S(output, "SIP/2.0/SCTP");
|
||||||
|
|
||||||
|
input = tls;
|
||||||
|
TEST(sip_transport_d(&input, &output), 0);
|
||||||
|
TEST_S(output, "SIP/2.0/TLS");
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
sip_expires_t *ex;
|
sip_expires_t *ex;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user