diff nginx-1.2.6/src/http/ngx_http_request.h nginx-1.2.6-orig//src/http/ngx_http_request.h
|
old
|
new
|
|
| 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 | |
diff nginx-1.2.6/src/http/ngx_http_variables.c nginx-1.2.6-orig//src/http/ngx_http_variables.c
|
old
|
new
|
|
| 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 | |
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
|
|
| 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 | |