View | Details | Raw Unified | Return to bug 55475
Collapse All | Expand All

(-)include/http_core.h (+8 lines)
Lines 698-703 apr_status_t ap_core_input_filter(ap_filter_t *f, Link Here
698
                                  ap_input_mode_t mode, apr_read_type_e block,
698
                                  ap_input_mode_t mode, apr_read_type_e block,
699
                                  apr_off_t readbytes);
699
                                  apr_off_t readbytes);
700
apr_status_t ap_core_output_filter(ap_filter_t *f, apr_bucket_brigade *b);
700
apr_status_t ap_core_output_filter(ap_filter_t *f, apr_bucket_brigade *b);
701
/**
702
 * When ap_core_input_filter with AP_MODE_GETLINE gets an immediate EOF from
703
 * the socket, should it return APR_SUCCESS with an empty brigade (legacy) or
704
 * return APR_EOF (default) ?
705
 */
706
#ifndef AP_CORE_INPUT_FILTER_GETLINE_EOF
707
#define AP_CORE_INPUT_FILTER_GETLINE_EOF 1
708
#endif
701
709
702
710
703
AP_DECLARE(const char*) ap_get_server_protocol(server_rec* s);
711
AP_DECLARE(const char*) ap_get_server_protocol(server_rec* s);
(-)server/core_filters.c (+19 lines)
Lines 152-157 apr_status_t ap_core_input_filter(ap_filter_t *f, Link Here
152
        if (APR_STATUS_IS_EAGAIN(rv) && block == APR_NONBLOCK_READ) {
152
        if (APR_STATUS_IS_EAGAIN(rv) && block == APR_NONBLOCK_READ) {
153
            rv = APR_SUCCESS;
153
            rv = APR_SUCCESS;
154
        }
154
        }
155
#if AP_CORE_INPUT_FILTER_GETLINE_EOF
156
        /* When the socket is immediatly EOF, apr_brigade_split_line returns
157
         * APR_SUCCESS with an empty brigade (socket_bucket_read morphes the
158
         * socket into an empty buffer which in turn is stripped by
159
         * apr_brigade_split_line).
160
         *
161
         * In blocking mode we should never return APR_SUCCESS with an empty
162
         * brigade, we are APR_EOF now and for the next calls.
163
         *
164
         * XXX: Note that we are EOF in any blocking mode (although callers
165
         * are used to empty brigade in non-blocking mode), should that break
166
         * some logic, one can "&& block == APR_BLOCK_READ" here, but if it's
167
         * OK, let's avoid a next call...
168
         */
169
        else if (rv == APR_SUCCESS && APR_BRIGADE_EMPTY(b)
170
                 && APR_BRIGADE_EMPTY(ctx->b)) {
171
            rv = APR_EOF;
172
        }
173
#endif
155
        return rv;
174
        return rv;
156
    }
175
    }
157
176

Return to bug 55475