Opened 7 years ago

Closed 15 months ago

#293 closed enhancement (fixed)

implement $limit_rate_after, similar to $limit_rate

Reported by: Yuntaek LIM Owned by: Maxim Dounin
Priority: minor Milestone:
Component: nginx-core Version: 1.2.x
Keywords: Cc:
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 Yuntaek LIM 7 years ago.
limit_rate_after.2.patch (14.3 KB ) - added by Yuntaek LIM 7 years ago.
limit_rate_after.3.patch (1.8 KB ) - added by Yuntaek LIM 7 years ago.
patch-nginx-limit-rate-after.txt (2.8 KB ) - added by Maxim Dounin 7 years ago.
Just for history, correct patch to implement $limit_rate_after.

Download all attachments as: .zip

Change History (11)

by Yuntaek LIM, 7 years ago

Attachment: limit_rate_after.patch added

comment:1 by Ruslan Ermilov, 7 years ago

Could you please properly resubmit the patch?

by Yuntaek LIM, 7 years ago

Attachment: limit_rate_after.2.patch added

by Yuntaek LIM, 7 years ago

Attachment: limit_rate_after.3.patch added

comment:2 by Yuntaek LIM, 7 years ago

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

in reply to:  1 comment:3 by Yuntaek Lim, 7 years ago

Replying to Ruslan Ermilov:

Could you please properly resubmit the patch?

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

comment:4 by Maxim Dounin, 7 years ago

Owner: set to Maxim Dounin
Status: newassigned
Summary: 'rs' Parameter does not work using 'ri' parameter togetherimplement $limit_rate_after, similar to $limit_rate
Type: defectenhancement

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 by Maxim Dounin, 7 years ago

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.

by Maxim Dounin, 7 years ago

Just for history, correct patch to implement $limit_rate_after.

comment:6 by Ruslan Ermilov <ru@…>, 16 months ago

In 7504:c19ca381b2e6/nginx:

Variables support in limit_rate and limit_rate_after (ticket #293).

comment:7 by Maxim Dounin, 15 months ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.