Revert "Add addr in error msg if stun sock sent with error"
This reverts commit 9ff75a6206142fbe17997bb092f8ec5485c2a084. Reason for revert: Breaks downstream project. Original change's description: > Add addr in error msg if stun sock sent with error > > Before: > ``` > (stun_port.cc:596): sendto : [0x00000041] No route to host > ``` > > After: > ``` > (stun_port.cc:598): UDP send of 20 bytes to host stun1.l.google.com:19302 (74.125.200.127:19302) failed with error 65 : [0x00000041] No route to host > ``` > > Bug: None > Change-Id: Ibcd487e97b37677225814562df30af66f655cddb > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215000 > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > Commit-Queue: Yura Yaroshevich <yura.yaroshevich@gmail.com> > Cr-Commit-Position: refs/heads/master@{#33694} TBR=hta@webrtc.org,yura.yaroshevich@gmail.com Change-Id: I3dacddfd60f4406609ed79845a545959d6208bcc No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: None Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215062 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33697}
This commit is contained in:

committed by
Commit Bot

parent
80939356cc
commit
dc53ce63a1
@ -306,9 +306,7 @@ int UDPPort::SendTo(const void* data,
|
||||
if (send_error_count_ < kSendErrorLogLimit) {
|
||||
++send_error_count_;
|
||||
RTC_LOG(LS_ERROR) << ToString() << ": UDP send of " << size
|
||||
<< " bytes to host " << addr.ToSensitiveString() << " ("
|
||||
<< addr.ToResolvedSensitiveString()
|
||||
<< ") failed with error " << error_;
|
||||
<< " bytes failed with error " << error_;
|
||||
}
|
||||
} else {
|
||||
send_error_count_ = 0;
|
||||
@ -595,11 +593,7 @@ void UDPPort::OnSendPacket(const void* data, size_t size, StunRequest* req) {
|
||||
options.info_signaled_after_sent.packet_type = rtc::PacketType::kStunMessage;
|
||||
CopyPortInformationToPacketInfo(&options.info_signaled_after_sent);
|
||||
if (socket_->SendTo(data, size, sreq->server_addr(), options) < 0) {
|
||||
RTC_LOG_ERR_EX(LERROR, socket_->GetError())
|
||||
<< "UDP send of " << size << " bytes to host "
|
||||
<< sreq->server_addr().ToSensitiveString() << " ("
|
||||
<< sreq->server_addr().ToResolvedSensitiveString()
|
||||
<< ") failed with error " << error_;
|
||||
RTC_LOG_ERR_EX(LERROR, socket_->GetError()) << "sendto";
|
||||
}
|
||||
stats_.stun_binding_requests_sent++;
|
||||
}
|
||||
|
@ -178,16 +178,6 @@ std::string SocketAddress::ToSensitiveString() const {
|
||||
return sb.str();
|
||||
}
|
||||
|
||||
std::string SocketAddress::ToResolvedSensitiveString() const {
|
||||
if (IsUnresolvedIP()) {
|
||||
return "";
|
||||
}
|
||||
char buf[1024];
|
||||
rtc::SimpleStringBuilder sb(buf);
|
||||
sb << ipaddr().ToSensitiveString() << ":" << port();
|
||||
return sb.str();
|
||||
}
|
||||
|
||||
bool SocketAddress::FromString(const std::string& str) {
|
||||
if (str.at(0) == '[') {
|
||||
std::string::size_type closebracket = str.rfind(']');
|
||||
|
@ -124,10 +124,6 @@ class RTC_EXPORT SocketAddress {
|
||||
// Same as ToString but anonymizes it by hiding the last part.
|
||||
std::string ToSensitiveString() const;
|
||||
|
||||
// Returns hostname:port string if address is resolved, otherwise returns
|
||||
// empty string.
|
||||
std::string ToResolvedSensitiveString() const;
|
||||
|
||||
// Parses hostname:port and [hostname]:port.
|
||||
bool FromString(const std::string& str);
|
||||
|
||||
|
Reference in New Issue
Block a user