diff --git a/libs/apr/network_io/beos/sendrecv.c b/libs/apr/network_io/beos/sendrecv.c index 618b2c6a8b..eff9494c85 100644 --- a/libs/apr/network_io/beos/sendrecv.c +++ b/libs/apr/network_io/beos/sendrecv.c @@ -117,8 +117,9 @@ APR_DECLARE(fspr_status_t) fspr_socket_recv(fspr_socket_t *sock, char *buf, return errno; } (*len) = rv; - if (rv == 0) + if (rv == 0 && sock->type == SOCK_STREAM) return APR_EOF; + return APR_SUCCESS; } @@ -205,7 +206,7 @@ APR_DECLARE(fspr_status_t) fspr_socket_recvfrom(fspr_sockaddr_t *from, } (*len) = rv; - if (rv == 0) + if (rv == 0 && sock->type == SOCK_STREAM) return APR_EOF; return APR_SUCCESS; diff --git a/libs/apr/network_io/os2/sendrecv.c b/libs/apr/network_io/os2/sendrecv.c index 8f0fbf805c..16ff823e7a 100644 --- a/libs/apr/network_io/os2/sendrecv.c +++ b/libs/apr/network_io/os2/sendrecv.c @@ -100,7 +100,10 @@ APR_DECLARE(fspr_status_t) fspr_socket_recv(fspr_socket_t *sock, char *buf, } (*len) = rv; - return rv == 0 ? APR_EOF : APR_SUCCESS; + if (rv == 0 && sock->type == SOCK_STREAM) + return APR_EOF; + + return APR_SUCCESS; } diff --git a/libs/apr/network_io/unix/sendrecv.c b/libs/apr/network_io/unix/sendrecv.c index 2015bf0bfc..64a83c344e 100644 --- a/libs/apr/network_io/unix/sendrecv.c +++ b/libs/apr/network_io/unix/sendrecv.c @@ -105,9 +105,10 @@ do_select: sock->options |= APR_INCOMPLETE_READ; } (*len) = rv; - if (rv == 0) { + if (rv == 0 && sock->type == SOCK_STREAM) { return APR_EOF; } + return APR_SUCCESS; } diff --git a/libs/apr/network_io/win32/sendrecv.c b/libs/apr/network_io/win32/sendrecv.c index 63891a50c6..897c6f6371 100644 --- a/libs/apr/network_io/win32/sendrecv.c +++ b/libs/apr/network_io/win32/sendrecv.c @@ -90,7 +90,10 @@ APR_DECLARE(fspr_status_t) fspr_socket_recv(fspr_socket_t *sock, char *buf, } *len = dwBytes; - return dwBytes == 0 ? APR_EOF : APR_SUCCESS; + if (rv == 0 && sock->type == SOCK_STREAM) + return APR_EOF; + + return APR_SUCCESS; }