From 20b26c18973dcbe4b324d797eca0f7b1f759a9cc Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Mon, 9 Jul 2012 23:26:06 +0000 Subject: Ignore all sendto() errors for P2P sockets on the client side. This is a workaround for the linked bug. BUG=135210 Review URL: https://chromiumcodereview.appspot.com/10752005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145781 0039d316-1c4b-4281-b951-d872f2087c98 --- .../client/plugin/pepper_packet_socket_factory.cc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'remoting/client') diff --git a/remoting/client/plugin/pepper_packet_socket_factory.cc b/remoting/client/plugin/pepper_packet_socket_factory.cc index f83180b..f5677c9 100644 --- a/remoting/client/plugin/pepper_packet_socket_factory.cc +++ b/remoting/client/plugin/pepper_packet_socket_factory.cc @@ -270,8 +270,24 @@ void UdpPacketSocket::OnSendCompleted(int result) { if (result != PP_ERROR_ABORTED) { LOG(ERROR) << "Send failed on a UDP socket: " << result; } - error_ = EINVAL; - return; + + // OS (e.g. OSX) may return EHOSTUNREACH when the peer has the + // same subnet address as the local host but connected to a + // different network. That error must be ingored because the + // socket may still be useful for other ICE canidadates (e.g. for + // STUN candidates with a different address). Unfortunately pepper + // interface currently returns PP_ERROR_FAILED for any error (see + // crbug.com/136406). It's not possible to distinguish that case + // from other errors and so we have to ingore all of them. This + // behavior matchers the libjingle's AsyncUDPSocket used by the + // host. + // + // TODO(sergeyu): Once implementation of the Pepper UDP interface + // is fixed, uncomment the code below, but ignore + // host-unreacheable error. + + // error_ = EINVAL; + // return; } send_queue_size_ -= send_queue_.front().data->size(); -- cgit v1.1