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

(-)modules/filters/mod_ratelimit.c (-3 / +12 lines)
Lines 63-68 rate_limit_filter(ap_filter_t *f, apr_bucket_briga Link Here
63
    rl_ctx_t *ctx = f->ctx;
63
    rl_ctx_t *ctx = f->ctx;
64
    apr_bucket_alloc_t *ba = f->r->connection->bucket_alloc;
64
    apr_bucket_alloc_t *ba = f->r->connection->bucket_alloc;
65
65
66
    ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, f->r,
67
                  "rate_limit_filter()");
68
66
    /* Set up our rl_ctx_t on first use */
69
    /* Set up our rl_ctx_t on first use */
67
    if (ctx == NULL) {
70
    if (ctx == NULL) {
68
71
Lines 192-200 rate_limit_filter(ap_filter_t *f, apr_bucket_briga Link Here
192
                 * Adjust the burst amount depending on how much
195
                 * Adjust the burst amount depending on how much
193
                 * we've done up to now.
196
                 * we've done up to now.
194
                 */
197
                 */
198
                if (APLOGrdebug(f->r)) {
199
                    apr_off_t rem = 0;
200
                    apr_brigade_length(bb, 0, &rem);
201
                    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, f->r,
202
                                  APLOGNO(03485) "rl: chunk %d; burst %d; "
203
                                  "len %"APR_OFF_T_FMT"; rem %"APR_OFF_T_FMT,
204
                                  ctx->chunk_size, ctx->burst, len, rem);
205
                }
195
                if (ctx->burst) {
206
                if (ctx->burst) {
196
                    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, f->r,
197
                        APLOGNO(03485) "rl: burst %d; len %"APR_OFF_T_FMT, ctx->burst, len);
198
                    if (len < ctx->burst) {
207
                    if (len < ctx->burst) {
199
                        ctx->burst -= len;
208
                        ctx->burst -= len;
200
                    }
209
                    }
Lines 327-333 static void register_hooks(apr_pool_t *p) Link Here
327
{
336
{
328
    /* run after mod_deflate etc etc, but not at connection level, ie, mod_ssl. */
337
    /* run after mod_deflate etc etc, but not at connection level, ie, mod_ssl. */
329
    ap_register_output_filter(RATE_LIMIT_FILTER_NAME, rate_limit_filter,
338
    ap_register_output_filter(RATE_LIMIT_FILTER_NAME, rate_limit_filter,
330
                              NULL, AP_FTYPE_PROTOCOL + 3);
339
                              NULL, AP_FTYPE_CONNECTION - 1);
331
}
340
}
332
341
333
AP_DECLARE_MODULE(ratelimit) = {
342
AP_DECLARE_MODULE(ratelimit) = {
(-)modules/http/chunk_filter.c (+5 lines)
Lines 30-35 Link Here
30
#include "http_core.h"
30
#include "http_core.h"
31
#include "http_protocol.h"  /* For index_of_response().  Grump. */
31
#include "http_protocol.h"  /* For index_of_response().  Grump. */
32
#include "http_request.h"
32
#include "http_request.h"
33
#include "http_log.h"
33
34
34
#include "util_filter.h"
35
#include "util_filter.h"
35
#include "util_ebcdic.h"
36
#include "util_ebcdic.h"
Lines 53-58 apr_status_t ap_http_chunk_filter(ap_filter_t *f, Link Here
53
    apr_bucket *e;
54
    apr_bucket *e;
54
    apr_status_t rv;
55
    apr_status_t rv;
55
56
57
    ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, f->r,
58
                  "ap_http_chunk_filter()");
59
56
    for (more = tmp = NULL; b; b = more, more = NULL) {
60
    for (more = tmp = NULL; b; b = more, more = NULL) {
57
        apr_off_t bytes = 0;
61
        apr_off_t bytes = 0;
58
        apr_bucket *eos = NULL;
62
        apr_bucket *eos = NULL;
Lines 69-74 apr_status_t ap_http_chunk_filter(ap_filter_t *f, Link Here
69
        {
73
        {
70
            if (APR_BUCKET_IS_EOS(e)) {
74
            if (APR_BUCKET_IS_EOS(e)) {
71
                /* there shouldn't be anything after the eos */
75
                /* there shouldn't be anything after the eos */
76
                /*ap_remove_output_filter(f);*/
72
                eos = e;
77
                eos = e;
73
                break;
78
                break;
74
            }
79
            }
(-)modules/http/http_filters.c (-1 / +12 lines)
Lines 1308-1315 AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_heade Link Here
1308
    else if (ctx->headers_sent) {
1308
    else if (ctx->headers_sent) {
1309
        /* Eat body if response must not have one. */
1309
        /* Eat body if response must not have one. */
1310
        if (r->header_only || r->status == HTTP_NO_CONTENT) {
1310
        if (r->header_only || r->status == HTTP_NO_CONTENT) {
1311
            /* Still next filters may be waiting for EOS, so pass it (alone)
1312
             * when encountered and be done with this filter.
1313
             */
1314
            e = APR_BRIGADE_LAST(b);
1315
            if (e != APR_BRIGADE_SENTINEL(b) && APR_BUCKET_IS_EOS(e)) {
1316
                APR_BUCKET_REMOVE(e);
1317
                apr_brigade_cleanup(b);
1318
                APR_BRIGADE_INSERT_HEAD(b, e);
1319
                ap_remove_output_filter(f);
1320
                rv = ap_pass_brigade(f->next, b);
1321
            }
1311
            apr_brigade_cleanup(b);
1322
            apr_brigade_cleanup(b);
1312
            return APR_SUCCESS;
1323
            return rv;
1313
        }
1324
        }
1314
    }
1325
    }
1315
1326

Return to bug 62568