From 9d34ad7f5bb2c732cfc41316035b145865d21d9e Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 30 Oct 2014 15:10:26 +0100 Subject: [PATCH] Added support for sockets pretending to not be sockets even though they are really sockets. Sockets. --- lib/socket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/socket.cpp b/lib/socket.cpp index 5aa905ba..e69ffc79 100644 --- a/lib/socket.cpp +++ b/lib/socket.cpp @@ -515,8 +515,10 @@ int Socket::Connection::iread(void * buffer, int len, int flags) { if (sock >= 0) { r = recv(sock, buffer, len, flags); } else { - //(pipes[1] >=0) { - r = read(pipes[1], buffer, len); + r = recv(pipes[1], buffer, len, flags); + if (r < 0 && errno == ENOTSOCK){ + r = read(pipes[1], buffer, len); + } } if (r < 0) { switch (errno) {