From 2870f9069b71a44b22e0c1a5dc2d6a098a1f9b0b Mon Sep 17 00:00:00 2001 From: rcritten <> Date: Thu, 19 Feb 2009 02:31:18 +0000 Subject: Return -1 on a read failure and set the appropriate NSPR error message. This bug has lingered for so long since mod_nss wasn't able to be used with mod_proxy until now. What one would see with this bug is sometimes a page would work, sometimes not (just the headers would be retrieved). The problem was we were return 0 which means EOF and was interpreted by upper levels to mean the transfer was done rather than no data being available. 484380 --- nss_engine_io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nss_engine_io.c') diff --git a/nss_engine_io.c b/nss_engine_io.c index 892f11c..4780aed 100644 --- a/nss_engine_io.c +++ b/nss_engine_io.c @@ -259,7 +259,8 @@ nspr_filter_in_read(PRFileDesc *fd, void *in, PRInt32 inlen) */ if (APR_STATUS_IS_EAGAIN(inctx->rc) || APR_STATUS_IS_EINTR(inctx->rc) || (inctx->rc == APR_SUCCESS && APR_BRIGADE_EMPTY(inctx->bb))) { - return 0; + PR_SetError(PR_WOULD_BLOCK_ERROR, 0); + return -1; } if (inctx->rc != APR_SUCCESS) { -- cgit