async_sock: return -1/EPIPE if we're getting an end of file on read.
[kai/samba-autobuild/.git] / lib / async_req / async_sock.c
index f5a0dfde708bd8b14065dcdbc09ad9e642a1fd3a..18adb42a0cb6aeeedbaf26429155db50ed3d1cd8 100644 (file)
@@ -160,6 +160,10 @@ static void async_recv_handler(struct tevent_context *ev,
                /* retry */
                return;
        }
+       if (state->received == 0) {
+               tevent_req_error(req, EPIPE);
+               return;
+       }
        if (state->received == -1) {
                tevent_req_error(req, errno);
                return;