diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/libwebrtc/p2p/base/port.cc | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/p2p/base/port.cc')
-rw-r--r-- | third_party/libwebrtc/p2p/base/port.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/third_party/libwebrtc/p2p/base/port.cc b/third_party/libwebrtc/p2p/base/port.cc index afd998c3ab..3069799f7b 100644 --- a/third_party/libwebrtc/p2p/base/port.cc +++ b/third_party/libwebrtc/p2p/base/port.cc @@ -13,6 +13,7 @@ #include <math.h> #include <algorithm> +#include <cstddef> #include <memory> #include <utility> #include <vector> @@ -31,6 +32,7 @@ #include "rtc_base/message_digest.h" #include "rtc_base/network.h" #include "rtc_base/numerics/safe_minmax.h" +#include "rtc_base/socket_address.h" #include "rtc_base/string_encode.h" #include "rtc_base/string_utils.h" #include "rtc_base/strings/string_builder.h" @@ -359,10 +361,10 @@ void Port::AddOrReplaceConnection(Connection* conn) { } } -void Port::OnReadPacket(const char* data, - size_t size, - const rtc::SocketAddress& addr, - ProtocolType proto) { +void Port::OnReadPacket(const rtc::ReceivedPacket& packet, ProtocolType proto) { + const char* data = reinterpret_cast<const char*>(packet.payload().data()); + size_t size = packet.payload().size(); + const rtc::SocketAddress& addr = packet.source_address(); // If the user has enabled port packets, just hand this over. if (enable_port_packets_) { SignalReadPacket(this, data, size, addr); @@ -452,7 +454,8 @@ bool Port::GetStunMessage(const char* data, // Parse the request message. If the packet is not a complete and correct // STUN message, then ignore it. std::unique_ptr<IceMessage> stun_msg(new IceMessage()); - rtc::ByteBufferReader buf(data, size); + rtc::ByteBufferReader buf( + rtc::MakeArrayView(reinterpret_cast<const uint8_t*>(data), size)); if (!stun_msg->Read(&buf) || (buf.Length() > 0)) { return false; } @@ -725,10 +728,7 @@ std::string Port::CreateStunUsername(absl::string_view remote_username) const { } bool Port::HandleIncomingPacket(rtc::AsyncPacketSocket* socket, - const char* data, - size_t size, - const rtc::SocketAddress& remote_addr, - int64_t packet_time_us) { + const rtc::ReceivedPacket& packet) { RTC_DCHECK_NOTREACHED(); return false; } |