Commit e625a1df authored by sergeyu@chromium.org's avatar sergeyu@chromium.org

Ingore ERR_ADDRESS_INVALID error returned from sendto().

This is a speculative fix for the failure in crbug.com/139136.
It's not clear why we get WSAEADDRNOTAVAIL from sendto(), but it should
be safe to ignore that error.

BUG=137140

Review URL: https://chromiumcodereview.appspot.com/10827064

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148784 0039d316-1c4b-4281-b951-d872f2087c98
parent 381fd4eb
......@@ -27,6 +27,13 @@ const int kReceiveBufferSize = 65536;
// reached under normal conditions.
const int kMaxSendBufferSize = 256 * 1024;
// Defines set of transient errors. These errors are ignored when we get them
// from sendto() calls.
bool IsTransientError(int error) {
return error == net::ERR_ADDRESS_UNREACHABLE ||
error == net::ERR_ADDRESS_INVALID;
}
class UdpPacketSocket : public talk_base::AsyncPacketSocket {
public:
UdpPacketSocket();
......@@ -264,8 +271,7 @@ void UdpPacketSocket::OnSendCompleted(int result) {
send_pending_ = false;
if (result < 0) {
// Treat all errors except ERR_ADDRESS_UNREACHABLE as fatal.
if (result != net::ERR_ADDRESS_UNREACHABLE) {
if (!IsTransientError(result)) {
LOG(ERROR) << "Send failed on a UDP socket: " << result;
error_ = EINVAL;
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment