aboutsummaryrefslogtreecommitdiffstats
path: root/src/gnutls_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnutls_io.c')
-rw-r--r--src/gnutls_io.c14
1 files changed, 13 insertions, 1 deletions
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,
670 */ 670 */
671 if (APR_STATUS_IS_EAGAIN(rc) || APR_STATUS_IS_EINTR(rc) 671 if (APR_STATUS_IS_EAGAIN(rc) || APR_STATUS_IS_EINTR(rc)
672 || (rc == APR_SUCCESS && APR_BRIGADE_EMPTY(ctxt->input_bb))) { 672 || (rc == APR_SUCCESS && APR_BRIGADE_EMPTY(ctxt->input_bb))) {
673 return 0; 673
674 if (APR_STATUS_IS_EOF(ctxt->input_rc)) {
675 return 0;
676 } else {
677 gnutls_transport_set_errno(ctxt->session, EINTR);
678 return -1;
679 }
674 } 680 }
681
675 682
676 if (rc != APR_SUCCESS) { 683 if (rc != APR_SUCCESS) {
677 /* Unexpected errors discard the brigade */ 684 /* Unexpected errors discard the brigade */
@@ -689,6 +696,11 @@ ssize_t mgs_transport_read(gnutls_transport_ptr_t ptr,
689 696
690 if (APR_STATUS_IS_EAGAIN(ctxt->input_rc) 697 if (APR_STATUS_IS_EAGAIN(ctxt->input_rc)
691 || APR_STATUS_IS_EINTR(ctxt->input_rc)) { 698 || APR_STATUS_IS_EINTR(ctxt->input_rc)) {
699 if (len == 0) {
700 gnutls_transport_set_errno(ctxt->session, EINTR);
701 return -1;
702 }
703
692 return (ssize_t) len; 704 return (ssize_t) len;
693 } 705 }
694 706