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