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

(-)modules/filters/mod_reqtimeout.c (-10 / +10 lines)
Lines 31-37 module AP_MODULE_DECLARE_DATA reqtimeout_module; Link Here
31
#define UNSET                            -1
31
#define UNSET                            -1
32
#define MRT_DEFAULT_handshake_TIMEOUT     0 /* disabled */
32
#define MRT_DEFAULT_handshake_TIMEOUT     0 /* disabled */
33
#define MRT_DEFAULT_handshake_MAX_TIMEOUT 0
33
#define MRT_DEFAULT_handshake_MAX_TIMEOUT 0
34
#define MRT_DEFAULT_handshake_MIN_RATE    APR_INT32_MAX
34
#define MRT_DEFAULT_handshake_MIN_RATE    0
35
#define MRT_DEFAULT_header_TIMEOUT       20
35
#define MRT_DEFAULT_header_TIMEOUT       20
36
#define MRT_DEFAULT_header_MAX_TIMEOUT   40
36
#define MRT_DEFAULT_header_MAX_TIMEOUT   40
37
#define MRT_DEFAULT_header_MIN_RATE      500
37
#define MRT_DEFAULT_header_MIN_RATE      500
Lines 220-226 static apr_status_t reqtimeout_filter(ap_filter_t Link Here
220
    if (block == APR_NONBLOCK_READ || mode == AP_MODE_INIT
220
    if (block == APR_NONBLOCK_READ || mode == AP_MODE_INIT
221
        || mode == AP_MODE_EATCRLF) {
221
        || mode == AP_MODE_EATCRLF) {
222
        rv = ap_get_brigade(f->next, bb, mode, block, readbytes);
222
        rv = ap_get_brigade(f->next, bb, mode, block, readbytes);
223
        if (ccfg->cur_stage.rate_factor > 0 && rv == APR_SUCCESS) {
223
        if (ccfg->cur_stage.rate_factor && rv == APR_SUCCESS) {
224
            extend_timeout(ccfg, bb);
224
            extend_timeout(ccfg, bb);
225
        }
225
        }
226
        return rv;
226
        return rv;
Lines 254-260 static apr_status_t reqtimeout_filter(ap_filter_t Link Here
254
            }
254
            }
255
255
256
            if (!APR_BRIGADE_EMPTY(bb)) {
256
            if (!APR_BRIGADE_EMPTY(bb)) {
257
                if (ccfg->cur_stage.rate_factor > 0) {
257
                if (ccfg->cur_stage.rate_factor) {
258
                    extend_timeout(ccfg, bb);
258
                    extend_timeout(ccfg, bb);
259
                }
259
                }
260
260
Lines 315-321 static apr_status_t reqtimeout_filter(ap_filter_t Link Here
315
         * the real (relevant) bytes to be asked later, within the
315
         * the real (relevant) bytes to be asked later, within the
316
         * currently alloted time.
316
         * currently alloted time.
317
         */
317
         */
318
        if (ccfg->cur_stage.rate_factor > 0 && rv == APR_SUCCESS
318
        if (ccfg->cur_stage.rate_factor && rv == APR_SUCCESS
319
                && mode != AP_MODE_SPECULATIVE) {
319
                && mode != AP_MODE_SPECULATIVE) {
320
            extend_timeout(ccfg, bb);
320
            extend_timeout(ccfg, bb);
321
        }
321
        }
Lines 638-654 static void reqtimeout_hooks(apr_pool_t *pool) Link Here
638
    ap_hook_post_read_request(reqtimeout_before_body, NULL, NULL,
638
    ap_hook_post_read_request(reqtimeout_before_body, NULL, NULL,
639
                              APR_HOOK_MIDDLE);
639
                              APR_HOOK_MIDDLE);
640
640
641
#if MRT_DEFAULT_HANDSHAKE_MIN_RATE > 0
641
#if MRT_DEFAULT_handshake_MIN_RATE
642
    default_handshake_rate_factor = apr_time_from_sec(1) /
642
    default_handshake_rate_factor = apr_time_from_sec(1) /
643
                                    MRT_DEFAULT_HANDSHAKE_MIN_RATE;
643
                                    MRT_DEFAULT_handshake_MIN_RATE;
644
#endif
644
#endif
645
#if MRT_DEFAULT_HEADER_MIN_RATE > 0
645
#if MRT_DEFAULT_header_MIN_RATE
646
    default_header_rate_factor = apr_time_from_sec(1) /
646
    default_header_rate_factor = apr_time_from_sec(1) /
647
                                 MRT_DEFAULT_HEADER_MIN_RATE;
647
                                 MRT_DEFAULT_header_MIN_RATE;
648
#endif
648
#endif
649
#if MRT_DEFAULT_BODY_MIN_RATE > 0
649
#if MRT_DEFAULT_body_MIN_RATE
650
    default_body_rate_factor = apr_time_from_sec(1) /
650
    default_body_rate_factor = apr_time_from_sec(1) /
651
                               MRT_DEFAULT_BODY_MIN_RATE;
651
                               MRT_DEFAULT_body_MIN_RATE;
652
#endif
652
#endif
653
}
653
}
654
654

Return to bug 63325