Commit 209e68cf authored by Pekka Pessi's avatar Pekka Pessi

sdp_print.c: fixed printing of non-IN c

Thanks for Saurav Sahu for reporting this problem.

darcs-hash:20070417112606-55b16-c441ebd3168c412f597dd9bc6bd5b7d9b44f2f24.gz
parent 31836c95
......@@ -405,7 +405,13 @@ static void print_connection2(sdp_printer_t *p, sdp_connection_t const *c)
return;
}
sdp_printf(p, "%s%s%s", nettype, addrtype, c->c_address);
if (nettype && addrtype)
sdp_printf(p, "%s%s%s", nettype, addrtype, c->c_address);
else if (nettype)
sdp_printf(p, "%s%s%s", nettype, c->c_address);
else
sdp_printf(p, "%s", c->c_address);
if (c->c_mcast || c->c_ttl) {
sdp_printf(p, "/%u", c->c_ttl);
if (c->c_groups > 1)
......
......@@ -474,7 +474,7 @@ static char const pint_msg[] =
"o=- 2353687640 2353687640 IN IP4 128.3.4.5\r\n"
"s=marketing\r\n"
"e=john.jones.3@chinet.net\r\n"
"c= TN RFC2543 +1-201-406-4090\r\n"
"c=TN RFC2543 +1-201-406-4090\r\n"
"t=2353687640 0\r\n"
"m=audio 1 voice -\r\n"
;
......@@ -496,6 +496,8 @@ static int test_pint(void)
su_home_t *home = su_home_create();
sdp_parser_t *parser;
sdp_session_t *sdp;
sdp_printer_t *printer;
char const *m;
BEGIN();
......@@ -504,6 +506,11 @@ static int test_pint(void)
TEST_1((parser = sdp_parse(home, pint_msg, sizeof(pint_msg) - 1, sdp_f_anynet)));
TEST_1((sdp = sdp_session(parser)));
TEST_1((printer = sdp_print(home, sdp, NULL, -1, 0)));
TEST_1((m = sdp_message(printer)));
TEST_S(m, pint_msg);
TEST(sdp_message_size(printer), sizeof(pint_msg) - 1);
TEST_1((parser = sdp_parse(home, pint_torture_msg, sizeof(pint_torture_msg) - 1,
sdp_f_anynet)));
TEST_1((sdp = sdp_session(parser)));
......
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