diff options
author | Nokis Mavrogiannopoulos | 2010-03-15 20:48:49 +0000 |
---|---|---|
committer | Nokis Mavrogiannopoulos | 2010-03-15 20:48:49 +0000 |
commit | 86bdc93b0efe0bbfcc9b90775192f085ce27b9a9 (patch) | |
tree | e493bf6176b6f05a1737cfcf2c5ddd14b4838981 /src/gnutls_io.c | |
parent | fed285b4c3601bd6da08e8a5f07fc52b9f0c69cf (diff) |
Corrected issue with firefox and long post data (had to do
with read function not handling EAGAIN and EINTR correctly).
Diffstat (limited to 'src/gnutls_io.c')
-rw-r--r-- | src/gnutls_io.c | 14 |
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 | ||