From c29605678490614d90c3850438e13c36abc6d12f Mon Sep 17 00:00:00 2001
From: Mikko Koppanen <mikko@kuut.io>
Date: Tue, 10 Apr 2012 09:55:10 +0900
Subject: ETIMEDOUT is a valid error code here. Fixes intermittent assertion
 failure on laggy networks

---
 src/stream_engine.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/stream_engine.cpp b/src/stream_engine.cpp
index d9125d0..ed03f59 100644
--- a/src/stream_engine.cpp
+++ b/src/stream_engine.cpp
@@ -315,7 +315,8 @@ int xs::stream_engine_t::write (const void *data_, size_t size_)
         return 0;
 
     //  Signalise peer failure.
-    if (nbytes == -1 && (errno == ECONNRESET || errno == EPIPE))
+    if (nbytes == -1 && (errno == ECONNRESET || errno == EPIPE ||
+          errno == ETIMEDOUT))
         return -1;
 
     errno_assert (nbytes != -1);
-- 
cgit v1.2.3