You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2017/08/14 08:46:53 UTC
[trafficserver] branch quic-latest updated: Add a test case for
handling CONNECTION_CLOSE frames on FrameDispatcher
This is an automated email from the ASF dual-hosted git repository.
maskit pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/quic-latest by this push:
new 08ef8e4 Add a test case for handling CONNECTION_CLOSE frames on FrameDispatcher
08ef8e4 is described below
commit 08ef8e4d398e2084b28ac4e766dc34379b1b0720
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Mon Aug 14 17:45:42 2017 +0900
Add a test case for handling CONNECTION_CLOSE frames on FrameDispatcher
---
iocore/net/quic/Mock.h | 3 +++
iocore/net/quic/test/test_QUICFrameDispatcher.cc | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/iocore/net/quic/Mock.h b/iocore/net/quic/Mock.h
index 42b3c7b..6f0b14f 100644
--- a/iocore/net/quic/Mock.h
+++ b/iocore/net/quic/Mock.h
@@ -36,6 +36,8 @@ public:
void
handle_frame(std::shared_ptr<const QUICFrame> f) override
{
+ ++_frameCount[static_cast<int>(f->type())];
+ ++_totalFrameCount;
}
QUICApplication *get_application(QUICStreamId stream_id) override
@@ -62,6 +64,7 @@ public:
int _retransmit_count = 0;
Ptr<ProxyMutex> _mutex;
int _totalFrameCount = 0;
+ int _frameCount[256] = {0};
};
class MockQUICPacketTransmitter : public QUICPacketTransmitter
diff --git a/iocore/net/quic/test/test_QUICFrameDispatcher.cc b/iocore/net/quic/test/test_QUICFrameDispatcher.cc
index 53726a7..dfb6737 100644
--- a/iocore/net/quic/test/test_QUICFrameDispatcher.cc
+++ b/iocore/net/quic/test/test_QUICFrameDispatcher.cc
@@ -54,4 +54,13 @@ TEST_CASE("QUICFrameHandler", "[quic]")
CHECK(streamManager->getTotalFrameCount() == 1);
CHECK(flowController->getTotalFrameCount() == 1);
CHECK(congestionController->getTotalFrameCount() == 1);
+
+ // CONNECTION_CLOSE frame
+ QUICConnectionCloseFrame connectionCloseFrame({});
+ connectionCloseFrame.store(buf, &len);
+ quicFrameDispatcher.receive_frames(buf, len);
+ CHECK(connection->getTotalFrameCount() == 1);
+ CHECK(streamManager->getTotalFrameCount() == 1);
+ CHECK(flowController->getTotalFrameCount() == 1);
+ CHECK(congestionController->getTotalFrameCount() == 1);
}
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].