Commit 5cd4231d authored by Pekka Pessi's avatar Pekka Pessi

sip: adding Refer-Sub to default parser.

darcs-hash:20061207172850-65a35-44370b0823ad0a44bbb74935e2dca06f2dda92a7.gz
parent 9f598738
......@@ -136,10 +136,12 @@ sip_tag.c: sofia-sip/sip.h sip_extra_headers.txt
$(AWK_SIP_AWK) PR=$@ TEMPLATE=$(srcdir)/sip_tag.c.in $< \
sip_extra_headers.txt
sip_parser_table.c: sip_extra_headers.txt
sip_parser_table.c: sofia-sip/sip.h
$(AWK_SIP_AWK) PT=$@ TEMPLATE=$(srcdir)/sip_parser_table.c.in \
FLAGFILE=$(srcdir)/sip_bad_mask \
MC_HASH_SIZE=127 MC_SHORT_SIZE=26 $<
MC_HASH_SIZE=127 MC_SHORT_SIZE=26 $< sip_extra_headers.txt
sofia-sip/sip_extra.h: sofia-sip/sip_extra.h.in sip_extra_headers.txt
@-mkdir -p sofia-sip 2>/dev/null
......
#
# This file specifies extra SIP headers not included in default parser table
# (nor in sip_t structure)
# This file specifies extra SIP headers not included in sip_t structure
#
# The file format is:
# The line format is:
# C-name @SINCE sip_t-like-comment
#
#### EXTRA HEADER LIST STARTS HERE ####
refer_sub @VERSION_1_12_4 /**< Refer-Sub header */
refer_sub @VERSION_1_12_5 /**< Refer-Sub header */
#### EXTRA HEADER LIST ENDS HERE ####
......@@ -49,6 +49,7 @@
#define MSG_HDR_T union sip_header_u
#include <sofia-sip/sip_parser.h>
#include <sofia-sip/sip_extra.h>
#include <sofia-sip/msg_mclass.h>
......
......@@ -548,7 +548,7 @@ char *sip_refer_sub_dup_one(sip_header_t *dst, sip_header_t const *src,
b = msg_params_dup(&rs_dst->rs_params, rs_src->rs_params, b, xtra);
MSG_STRING_DUP(b, rs_dst->rs_value, rs_src->rs_value);
assert(b <= end);
assert(b <= end); (void)end;
return b;
}
......@@ -2082,16 +2082,20 @@ int test_refer(void)
TEST_1(home = su_home_create());
/* Add Refer-Sub to our parser */
/* Check that Refer-Sub has already been added to our parser */
TEST_1(msg_mclass_insert_with_mask(test_mclass, sip_refer_sub_class,
0, 0) >= 0);
0, 0) == -1);
msg = read_message(0, m); TEST_1(msg); TEST_1(sip = sip_object(msg));
TEST_1(sip->sip_refer_to);
TEST_S(sip->sip_refer_to->r_url->url_headers,
"Replaces=7d84c014-321368da-efa90f41%40"
"10.3.3.8%3Bto-tag%3DpaNKgBB9vQe3D%3Bfrom-tag%3D93AC8D50-7CF6DAAF");
TEST(msg_prepare(msg), strlen(m));
TEST_1(rs = sip_refer_sub(sip));
TEST_S(rs->rs_value, "true");
TEST_SIZE(msg_prepare(msg), strlen(m));
TEST_1(veclen = msg_iovec(msg, NULL, ISIZE_MAX));
TEST_1(iovec = su_zalloc(msg_home(home), veclen * (sizeof iovec[0])));
TEST_SIZE(msg_iovec(msg, iovec, veclen), veclen);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment