limit_rate_after.patch

이 동주, 2013-02-01 19:02

Download (1.8 kB)

nginx-1.2.6-orig//src/http/ngx_http_request.h 2012-07-02 14:41:52.000000000 -0300
419 419

  
420 420
    size_t                            limit_rate;
421 421

  
422
    size_t                            limit_rate_after;
423

  
424 422
    /* used to learn the Apache compatible response length without a header */
425 423
    size_t                            header_size;
426 424

  
nginx-1.2.6-orig//src/http/ngx_http_variables.c 2012-12-11 11:18:50.000000000 -0200
277 277
      offsetof(ngx_http_request_t, limit_rate),
278 278
      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },
279 279

  
280
    { ngx_string("limit_rate_after"), ngx_http_variable_request_set_size,
281
      ngx_http_variable_request_get_size,
282
      offsetof(ngx_http_request_t, limit_rate_after),
283
      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },
284

  
285 280
    { ngx_string("connection"), NULL,
286 281
      ngx_http_variable_connection, 0, 0, 0 },
287 282

  
nginx-1.2.6-orig//src/http/ngx_http_write_filter_module.c 2012-09-24 15:34:04.000000000 -0300
207 207
    }
208 208

  
209 209
    if (r->limit_rate) {
210

  
211
        if(r->limit_rate_after) {
212
            clcf->limit_rate_after = r->limit_rate_after;
213
        }
214

  
215 210
        limit = r->limit_rate * (ngx_time() - r->start_sec + 1)
216 211
                - (c->sent - clcf->limit_rate_after);
217 212