Prevent warning logs when signaling stats from connectionless sockets.

Signaling per-packet stats invokes GetRemoteAddress and a warning log is
output for each signal in SendTo for UDP sockets. This creates noise in
the debug log.

Bug: webrtc:9103
Change-Id: Ibf4667cf196aef971452f745bef3c02fb1dbf3d4
Reviewed-on: https://webrtc-review.googlesource.com/70364
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Bjorn Mellem <mellem@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22911}
This commit is contained in:
Qingsi Wang 2018-04-16 18:22:31 -07:00 committed by Commit Bot
parent 0676f224f8
commit 4ea53b356d
4 changed files with 8 additions and 4 deletions

View file

@ -30,10 +30,13 @@ AsyncPacketSocket::~AsyncPacketSocket() = default;
void CopySocketInformationToPacketInfo(size_t packet_size_bytes,
const AsyncPacketSocket& socket_from,
bool is_connectionless,
rtc::PacketInfo* info) {
info->packet_size_bytes = packet_size_bytes;
info->local_socket_address = socket_from.GetLocalAddress();
info->remote_socket_address = socket_from.GetRemoteAddress();
if (!is_connectionless) {
info->remote_socket_address = socket_from.GetRemoteAddress();
}
}
}; // namespace rtc

View file

@ -145,6 +145,7 @@ class AsyncPacketSocket : public sigslot::has_slots<> {
void CopySocketInformationToPacketInfo(size_t packet_size_bytes,
const AsyncPacketSocket& socket_from,
bool is_connectionless,
rtc::PacketInfo* info);
} // namespace rtc

View file

@ -299,7 +299,7 @@ int AsyncTCPSocket::Send(const void *pv, size_t cb,
rtc::SentPacket sent_packet(options.packet_id, rtc::TimeMillis(),
options.info_signaled_after_sent);
CopySocketInformationToPacketInfo(cb, *this, &sent_packet.info);
CopySocketInformationToPacketInfo(cb, *this, false, &sent_packet.info);
SignalSentPacket(this, sent_packet);
// We claim to have sent the whole thing, even if we only sent partial

View file

@ -62,7 +62,7 @@ int AsyncUDPSocket::Send(const void *pv, size_t cb,
const rtc::PacketOptions& options) {
rtc::SentPacket sent_packet(options.packet_id, rtc::TimeMillis(),
options.info_signaled_after_sent);
CopySocketInformationToPacketInfo(cb, *this, &sent_packet.info);
CopySocketInformationToPacketInfo(cb, *this, false, &sent_packet.info);
int ret = socket_->Send(pv, cb);
SignalSentPacket(this, sent_packet);
return ret;
@ -73,7 +73,7 @@ int AsyncUDPSocket::SendTo(const void *pv, size_t cb,
const rtc::PacketOptions& options) {
rtc::SentPacket sent_packet(options.packet_id, rtc::TimeMillis(),
options.info_signaled_after_sent);
CopySocketInformationToPacketInfo(cb, *this, &sent_packet.info);
CopySocketInformationToPacketInfo(cb, *this, true, &sent_packet.info);
sent_packet.info.remote_socket_address = addr;
int ret = socket_->SendTo(pv, cb, addr);
SignalSentPacket(this, sent_packet);