Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tcp-overflow test issue in TPORT. #109

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libsofia-sip-ua/nta/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ dist_noinst_SCRIPTS = run_test_nta_api run_test_nta

TESTS = run_check_nta run_test_nta_api run_test_nta

TESTS_ENVIRONMENT = $(SHELL)
#TESTS_ENVIRONMENT = $(SHELL)
TESTS_ENVIRONMENT =

# ----------------------------------------------------------------------
# Rules for building the targets
Expand Down
22 changes: 13 additions & 9 deletions libsofia-sip-ua/soa/test_soa.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,9 @@ int test_codec_selection(struct context *ctx)
TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected);
TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 3);
TEST_S(rm->rm_encoding, "GSM");
/* Using payload type 96 from offer */
TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 96);
/* We do not expect payload type as 96 here anymore as we stopped using the same payload type as remote had
since 4703f3ade78a89cdc37f673b5bde3435ab71dc27 so 97 stays. */
TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 97);
TEST_S(rm->rm_encoding, "G729");
TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 111);
TEST_S(rm->rm_encoding, "telephone-event");
Expand Down Expand Up @@ -1007,11 +1008,12 @@ int test_codec_selection(struct context *ctx)
TEST_S(rm->rm_encoding, "CN");
TEST_1(!rm->rm_next);

/* Answering end matches payload types
then sorts by local preference,
then select best codec => GSM with pt 97 */
/* Answering end matches payload types then sorts by local preference,
then select best codec => GSM with pt 3
Note : we stopped using the same payload type as remote had
since 4703f3ade78a89cdc37f673b5bde3435ab71dc27 so not expect 97 here. */
TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected);
TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 97);
TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 3);
TEST_S(rm->rm_encoding, "GSM");
TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 111);
TEST_S(rm->rm_encoding, "telephone-event");
Expand Down Expand Up @@ -1263,7 +1265,9 @@ int test_codec_selection(struct context *ctx)
TEST_1(!m->m_next);

TEST_1(m = b_sdp->sdp_media); TEST_1(!m->m_rejected);
TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 96);
/* We do not expect payload type as 96 here anymore as we stopped using the same payload type as remote had
since 4703f3ade78a89cdc37f673b5bde3435ab71dc27 so 97 stays. */
TEST_1(rm = m->m_rtpmaps); TEST(rm->rm_pt, 97);
TEST_S(rm->rm_encoding, "G729");
TEST_1(rm = rm->rm_next); TEST(rm->rm_pt, 111);
TEST_S(rm->rm_encoding, "telephone-event");
Expand Down Expand Up @@ -2240,11 +2244,11 @@ int test_address_selection(struct context *ctx)
TEST_OC_ADDRESS(a, "2001:1508:1003::21a:a0ff:fe71:813", ip6);
TEST_VOID(soa_terminate(a, NULL));

/* SOATAG_AF(SOA_AF_IP4_IP6), o= mentions IP6 => select IP4 */
/* SOATAG_AF(SOA_AF_IP4_IP6) and SOATAG_USER_O_LINE() tag remove from so, o= mentions IP6 => select IP6 */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have SOATAG_USER_O_LINE() tag in our codebase. But we have it's functionality enabled by default.

n = soa_set_user_sdp(a, 0, "o=- 1 1 IN IP6 ::\r\n"
"m=audio 5008 RTP/AVP 0 8", -1); TEST(n, 1);
n = soa_generate_offer(a, 1, test_completed); TEST(n, 0);
TEST_OC_ADDRESS(a, "11.12.13.14", ip4);
TEST_OC_ADDRESS(a, "2001:1508:1003::21a:a0ff:fe71:813", ip6);
TEST_VOID(soa_process_reject(a, NULL));

/* SOATAG_AF(SOA_AF_IP4_IP6), c= uses non-local IP6
Expand Down
4 changes: 2 additions & 2 deletions libsofia-sip-ua/tport/test_tport.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ msg_t *tp_test_msg(tp_test_t *tt, int flags,
{
msg_t *msg = msg_create(tt->tt_mclass, flags);

msg_maxsize(msg, 2 * 1024 * 1024);
msg_maxsize(msg, 5 * 1024 * 1024);

return msg;
}
Expand Down Expand Up @@ -869,7 +869,7 @@ static int tcp_test(tp_test_t *tt)
#ifndef WIN32 /* Windows seems to be buffering too much */

/* Create a large message, just to force queueing in sending end */
TEST(new_test_msg(tt, &msg, "tcp-0", 1, 16 * 64 * 1024), 0);
TEST(new_test_msg(tt, &msg, "tcp-0", 1, 4 * 1024 * 1024), 0);
test_create_md5(tt, msg);
TEST_1(tp = tport_tsend(tt->tt_tports, msg, tt->tt_tcp_name, TAG_END()));
N++;
Expand Down