summaryrefslogtreecommitdiffstats
path: root/remoting/jingle_glue
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-27 19:11:24 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-27 19:11:24 +0000
commite625a1df0d9e61c6d480e779672cbc4892747363 (patch)
tree6d27e5c20ec112a0a4faf89c9d310f33ab876784 /remoting/jingle_glue
parent381fd4eb3592cb8767f570d205a062d75d18d63a (diff)
downloadchromium_src-e625a1df0d9e61c6d480e779672cbc4892747363.zip
chromium_src-e625a1df0d9e61c6d480e779672cbc4892747363.tar.gz
chromium_src-e625a1df0d9e61c6d480e779672cbc4892747363.tar.bz2
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
Diffstat (limited to 'remoting/jingle_glue')
-rw-r--r--remoting/jingle_glue/chromium_socket_factory.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/remoting/jingle_glue/chromium_socket_factory.cc b/remoting/jingle_glue/chromium_socket_factory.cc
index 7de727c..9600f47 100644
--- a/remoting/jingle_glue/chromium_socket_factory.cc
+++ b/remoting/jingle_glue/chromium_socket_factory.cc
@@ -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;