--- src/xrep_original.cpp	2011-03-09 12:24:46.000000000 +0300
+++ src/xrep.cpp	2011-03-09 12:26:43.000000000 +0300
@@ -161,6 +161,12 @@
         //  Remember the outgoing pipe.
         current_out = it->second.writer;
 
+        if (!current_out->check_write ()) {
+            it->second.active = false;
+            errno = EAGAIN;
+            return -1;
+        }
+        
         return 0;
     }
 
