Opened 5 years ago

Last modified 5 years ago

#293 assigned enhancement

implement $limit_rate_after, similar to $limit_rate

Reported by: www.google.com/accounts/o8/id?id=AItOawl4c6eD7ZnZqFoLdaS7LBxUubiPWy9OZGg Owned by: mdounin
Priority: minor Milestone:
Component: nginx-core Version: 1.2.x
Keywords: Cc:
Sensitive: no
uname -a: Linux SVC2-01 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.2.6

Description

Hi,

This issue would be out of AMI-Support range. However, I would like to know if this is a bug before creating new ticket on 'nignx.org'.

When I set 'ri' and 'rs' parameters together, the value of 'rs' is not applied.
When client requests as an below example with a following configuration, 'limit_rate_after', which is dependent on 'rs' parameter,does not work.

Configuation

server {
        server_name test-domain.com
        root    /htdocs;

        location ~* \.flv {
            flv;
            if ($arg_LRA) {
                set $limit_rate_after $arg_LRA;
            }
            if ($arg_LR) {
                set $limit_rate "${arg_LR}k";
            }
        }
    }


Example of client request

curl -o /dev/null -H "Host: test-domain.com" http://localhost/test.flv?ri=100&rs=8192000

The result of client request shows that 'limit_rate' 100k has worked but limit_rate_after 8192000 has not worked.

I assumed that this is bug, so I've adjusted attached patch file which are modified below files.

./src/http/ngx_http_request.h
./src/http/ngx_http_variables.c
./src/http/ngx_http_write_filter_module.c

I would like to know if there is a problem in my configuration or it is bug.

Attachments (4)

limit_rate_after.patch (14.3 KB) - added by www.google.com/accounts/o8/id?id=AItOawl4c6eD7ZnZqFoLdaS7LBxUubiPWy9OZGg 5 years ago.
limit_rate_after.2.patch (14.3 KB) - added by www.google.com/accounts/o8/id?id=AItOawl4c6eD7ZnZqFoLdaS7LBxUubiPWy9OZGg 5 years ago.
limit_rate_after.3.patch (1.8 KB) - added by www.google.com/accounts/o8/id?id=AItOawl4c6eD7ZnZqFoLdaS7LBxUubiPWy9OZGg 5 years ago.
patch-nginx-limit-rate-after.txt (2.8 KB) - added by mdounin 5 years ago.
Just for history, correct patch to implement $limit_rate_after.

Download all attachments as: .zip

Change History (9)

Changed 5 years ago by www.google.com/accounts/o8/id?id=AItOawl4c6eD7ZnZqFoLdaS7LBxUubiPWy9OZGg

comment:1 follow-up: Changed 5 years ago by ru

Could you please properly resubmit the patch?

Changed 5 years ago by www.google.com/accounts/o8/id?id=AItOawl4c6eD7ZnZqFoLdaS7LBxUubiPWy9OZGg

Changed 5 years ago by www.google.com/accounts/o8/id?id=AItOawl4c6eD7ZnZqFoLdaS7LBxUubiPWy9OZGg

comment:2 Changed 5 years ago by www.google.com/accounts/o8/id?id=AItOawl4c6eD7ZnZqFoLdaS7LBxUubiPWy9OZGg

I've just attached right file(limit_rate_after.3.patch). Sorry for submitting wrong file.

comment:3 in reply to: ↑ 1 Changed 5 years ago by yuntaek.lim@…

Replying to Ruslan Ermilov:

Could you please properly resubmit the patch?

I would like to know when you will consider this issue.

comment:4 Changed 5 years ago by mdounin

  • Owner set to mdounin
  • Status changed from new to assigned
  • Summary changed from 'rs' Parameter does not work using 'ri' parameter together to implement $limit_rate_after, similar to $limit_rate
  • Type changed from defect to enhancement

The patch you attached is wrong as it overrides configuration, thus affecting subsequent request to the same worker process. Overral I think support for $limit_rate_after make sense, I'll take core of it.

comment:5 Changed 5 years ago by mdounin

We've discussed this with Igor, and agreed that it's not a good idea to introduce more magic variables like $limit_rate. Instead, the "limit_rate" directive should be changed to support variables and the $limit_rate magic variable should be deprecated accordingly. Accordingly, there will be no $limit_rate_after, but the "limit_rate_after" directive will be changed to understand variables.

Changed 5 years ago by mdounin

Just for history, correct patch to implement $limit_rate_after.

Note: See TracTickets for help on using tickets.