Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Unified Diff: remoting/jingle_glue/chromium_socket_factory.cc

Issue 10827064: Ignore ERR_ADDRESS_INVALID error returned from sendto(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/jingle_glue/chromium_socket_factory.cc
diff --git a/remoting/jingle_glue/chromium_socket_factory.cc b/remoting/jingle_glue/chromium_socket_factory.cc
index 7de727c4668e6ccaf805478b22b63a8e64774a22..9600f47c4ab981d69582aa63fa8092c228dfe07d 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698