Ticket #293: limit_rate_after.3.patch

File limit_rate_after.3.patch, 1.8 KB (added by Yuntaek LIM, 13 years ago)
  • src/http/ngx_http_request.h

    diff nginx-1.2.6/src/http/ngx_http_request.h nginx-1.2.6-orig//src/http/ngx_http_request.h
    old new  
    419419
    420420    size_t                            limit_rate;
    421421
    422     size_t                            limit_rate_after;
    423 
    424422    /* used to learn the Apache compatible response length without a header */
    425423    size_t                            header_size;
    426424
  • src/http/ngx_http_variables.c

    diff nginx-1.2.6/src/http/ngx_http_variables.c nginx-1.2.6-orig//src/http/ngx_http_variables.c
    old new  
    277277      offsetof(ngx_http_request_t, limit_rate),
    278278      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },
    279279
    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 
    285280    { ngx_string("connection"), NULL,
    286281      ngx_http_variable_connection, 0, 0, 0 },
    287282
  • src/http/ngx_http_write_filter_module.c

    diff nginx-1.2.6/src/http/ngx_http_write_filter_module.c nginx-1.2.6-orig//src/http/ngx_http_write_filter_module.c
    old new  
    207207    }
    208208
    209209    if (r->limit_rate) {
    210 
    211         if(r->limit_rate_after) {
    212             clcf->limit_rate_after = r->limit_rate_after;
    213         }
    214 
    215210        limit = r->limit_rate * (ngx_time() - r->start_sec + 1)
    216211                - (c->sent - clcf->limit_rate_after);
    217212