diff options
author | Kennan Gumbs <kennangumbs@google.com> | 2021-07-07 15:54:14 -0400 |
---|---|---|
committer | Openscreen LUCI CQ <openscreen-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2021-07-14 01:16:32 +0000 |
commit | 7e167e2bc4c8c0c650f00b995e1e20cb1ae1f479 (patch) | |
tree | 6a84d39db2234179deaac624ec05e0d86c40ceb1 /cast/streaming/sender_packet_router.cc | |
parent | 01c7cc260a28bc0a814249f41825b35e021be271 (diff) | |
download | openscreen-7e167e2bc4c8c0c650f00b995e1e20cb1ae1f479.tar.gz |
Remove abseil dependency from HexEncode method
Currently the HexEncode method defined in util/stringprintf.h depends on
absl::Span, which is part of abseil. This patch removes the dependency,
allowing the method to be more widely used.
Bug: b/158660166
Change-Id: I37715271391000b5c61d5a657f604db2bc6c882e
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/3001949
Reviewed-by: Jordan Bayles <jophba@chromium.org>
Commit-Queue: Jordan Bayles <jophba@chromium.org>
Diffstat (limited to 'cast/streaming/sender_packet_router.cc')
-rw-r--r-- | cast/streaming/sender_packet_router.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cast/streaming/sender_packet_router.cc b/cast/streaming/sender_packet_router.cc index c2b23dbf..684b1fb2 100644 --- a/cast/streaming/sender_packet_router.cc +++ b/cast/streaming/sender_packet_router.cc @@ -102,10 +102,11 @@ void SenderPacketRouter::OnReceivedPacket(const IPEndpoint& source, InspectPacketForRouting(packet); if (seems_like.first != ApparentPacketType::RTCP) { constexpr int kMaxPartiaHexDumpSize = 96; + const std::size_t encode_size = + std::min(packet.size(), static_cast<size_t>(kMaxPartiaHexDumpSize)); OSP_LOG_WARN << "UNKNOWN packet of " << packet.size() << " bytes. Partial hex dump: " - << HexEncode(absl::Span<const uint8_t>(packet).subspan( - 0, kMaxPartiaHexDumpSize)); + << HexEncode(packet.data(), encode_size); return; } const auto it = FindEntry(seems_like.second); |