From cc960a324f6806114840259f194e18602d480102 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Sat, 27 Mar 2021 10:07:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E7=BA=BF=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/DtlsTransport.hpp | 3 ++- webrtc/IceServer.cpp | 4 ---- webrtc/IceServer.hpp | 3 +++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/webrtc/DtlsTransport.hpp b/webrtc/DtlsTransport.hpp index f1b10ca7..b3fa244e 100644 --- a/webrtc/DtlsTransport.hpp +++ b/webrtc/DtlsTransport.hpp @@ -227,7 +227,8 @@ namespace RTC bool handshakeDone{ false }; bool handshakeDoneNow{ false }; std::string remoteCert; - static constexpr int SslReadBufferSize{ 65536 }; + //最大不超过mtu + static constexpr int SslReadBufferSize{ 1600 }; uint8_t sslReadBuffer[SslReadBufferSize]; }; } // namespace RTC diff --git a/webrtc/IceServer.cpp b/webrtc/IceServer.cpp index 38963c58..d80ef0f0 100644 --- a/webrtc/IceServer.cpp +++ b/webrtc/IceServer.cpp @@ -7,10 +7,6 @@ namespace RTC { /* Static. */ - - static constexpr size_t StunSerializeBufferSize{ 65536 }; - static uint8_t StunSerializeBuffer[StunSerializeBufferSize]; - /* Instance methods. */ IceServer::IceServer(Listener* listener, const std::string& usernameFragment, const std::string& password) diff --git a/webrtc/IceServer.hpp b/webrtc/IceServer.hpp index ad5d93eb..103727f0 100644 --- a/webrtc/IceServer.hpp +++ b/webrtc/IceServer.hpp @@ -106,6 +106,9 @@ namespace RTC IceState state{ IceState::NEW }; std::list tuples; RTC::TransportTuple* selectedTuple{ nullptr }; + //最大不超过mtu + static constexpr size_t StunSerializeBufferSize{ 1600 }; + uint8_t StunSerializeBuffer[StunSerializeBufferSize]; }; } // namespace RTC