From 8c214dc96753a102540152f9211b963df9109b74 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 28 Oct 2019 08:57:11 +0800 Subject: [PATCH] Cover protocol stack RTMP. 3.0.63 --- trunk/src/utest/srs_utest_protostack.cpp | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/trunk/src/utest/srs_utest_protostack.cpp b/trunk/src/utest/srs_utest_protostack.cpp index 3c26e3452..b880d3e04 100644 --- a/trunk/src/utest/srs_utest_protostack.cpp +++ b/trunk/src/utest/srs_utest_protostack.cpp @@ -147,5 +147,31 @@ VOID TEST(ProtoStackTest, ManualFlush) HELPER_EXPECT_SUCCESS(p.manual_response_flush()); EXPECT_EQ(12+6, io.out_buffer.length()); } + + if (true) { + MockBufferIO io; + SrsProtocol p(&io); + + // Always response ACK message. + HELPER_EXPECT_SUCCESS(p.set_in_window_ack_size(1)); + + // When not auto response, need to flush it manually. + p.set_auto_response(false); + HELPER_EXPECT_SUCCESS(p.response_ping_message(1024)); + EXPECT_EQ(0, io.out_buffer.length()); + + // If not flushed, the packets will be destroyed. + } + + if (true) { + MockBufferIO io; + SrsProtocol p(&io); + + p.set_recv_buffer(0); + p.set_recv_buffer(131072 * 10); + + p.set_merge_read(true, NULL); + p.set_merge_read(false, NULL); + } }