- Timestamp:
- May 27, 2016, 12:26:15 PM (6 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, jessie-backports, master, proxy-ticket, upstream
- Children:
- eda8686
- Parents:
- a9fa300
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_io.c
ra9fa300 r19f2719 787 787 788 788 /* If Len = 0, we don't do anything. */ 789 if (!len || buffer == NULL) { 789 if (!len || buffer == NULL) 790 { 790 791 return 0; 791 792 } 792 if (!ctxt->input_bb) { 793 /* Input bucket brigade is missing, EOF */ 794 if (!ctxt->input_bb) 795 { 793 796 ctxt->input_rc = APR_EOF; 794 797 gnutls_transport_set_errno(ctxt->session, ECONNABORTED); … … 796 799 } 797 800 798 if (APR_BRIGADE_EMPTY(ctxt->input_bb)) {799 801 if (APR_BRIGADE_EMPTY(ctxt->input_bb)) 802 { 800 803 rc = ap_get_brigade(ctxt->input_filter->next, 801 ctxt->input_bb, AP_MODE_READBYTES,802 ctxt->input_block, in);804 ctxt->input_bb, AP_MODE_READBYTES, 805 ctxt->input_block, in); 803 806 804 807 /* Not a problem, there was simply no data ready yet. … … 820 823 } 821 824 822 if (rc != APR_SUCCESS) { 825 if (rc != APR_SUCCESS) 826 { 823 827 /* Unexpected errors discard the brigade */ 824 828 apr_brigade_cleanup(ctxt->input_bb); … … 829 833 } 830 834 831 ctxt->input_rc = 832 brigade_consume(ctxt->input_bb, block, buffer, &len); 833 834 if (ctxt->input_rc == APR_SUCCESS){835 ctxt->input_rc = brigade_consume(ctxt->input_bb, block, buffer, &len); 836 837 if (ctxt->input_rc == APR_SUCCESS) 838 { 835 839 return (ssize_t) len; 836 840 } … … 850 854 851 855 /* Unexpected errors and APR_EOF clean out the brigade. 852 * Subsequent calls will return APR_EOF. 853 */ 856 * Subsequent calls will return APR_EOF. */ 854 857 apr_brigade_cleanup(ctxt->input_bb); 855 858 ctxt->input_bb = NULL; 856 859 857 if (APR_STATUS_IS_EOF(ctxt->input_rc) && len) { 858 /* Provide the results of this read pass, 859 * without resetting the BIO retry_read flag 860 */ 860 if (APR_STATUS_IS_EOF(ctxt->input_rc) && len) 861 { 862 /* Some data has been received before EOF, return it. */ 861 863 return (ssize_t) len; 862 864 } … … 877 879 */ 878 880 ssize_t mgs_transport_write(gnutls_transport_ptr_t ptr, 879 const void *buffer, size_t len) { 881 const void *buffer, size_t len) 882 { 880 883 mgs_handle_t *ctxt = ptr; 881 884
Note: See TracChangeset
for help on using the changeset viewer.