From 9085f5b533fdf85e86c9d7ab2f0f4ac4c8906e2a Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 15 Mar 2010 20:48:49 +0000 Subject: Corrected issue with firefox and long post data (had to do with read function not handling EAGAIN and EINTR correctly). --- src/gnutls_io.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gnutls_io.c b/src/gnutls_io.c index 15de422..8187da6 100644 --- a/src/gnutls_io.c +++ b/src/gnutls_io.c @@ -670,8 +670,15 @@ ssize_t mgs_transport_read(gnutls_transport_ptr_t ptr, */ if (APR_STATUS_IS_EAGAIN(rc) || APR_STATUS_IS_EINTR(rc) || (rc == APR_SUCCESS && APR_BRIGADE_EMPTY(ctxt->input_bb))) { - return 0; + + if (APR_STATUS_IS_EOF(ctxt->input_rc)) { + return 0; + } else { + gnutls_transport_set_errno(ctxt->session, EINTR); + return -1; + } } + if (rc != APR_SUCCESS) { /* Unexpected errors discard the brigade */ @@ -689,6 +696,11 @@ ssize_t mgs_transport_read(gnutls_transport_ptr_t ptr, if (APR_STATUS_IS_EAGAIN(ctxt->input_rc) || APR_STATUS_IS_EINTR(ctxt->input_rc)) { + if (len == 0) { + gnutls_transport_set_errno(ctxt->session, EINTR); + return -1; + } + return (ssize_t) len; } -- cgit