Module: sip-router Branch: master Commit: 280f947eac5c66bfa6151c75983ffa9e533dd709 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=280f947e...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Thu Oct 30 22:29:01 2014 +0100
pipelimit: update the limit of pipe for pl_check(pipeid, alg, limit)
- affects the dynamic pipes that could have been created by same function on a previous execution, allowing to be on-the-fly updated - reported by Alex Balashov
---
modules/pipelimit/pipelimit.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules/pipelimit/pipelimit.c b/modules/pipelimit/pipelimit.c index 3e6b918..a060df7 100644 --- a/modules/pipelimit/pipelimit.c +++ b/modules/pipelimit/pipelimit.c @@ -625,9 +625,9 @@ static int w_pl_check3(struct sip_msg* msg, char *p1pipe, char *p2alg, if(msg==NULL) return -1;
- if(fixup_get_ivalue(msg, (gparam_t*)p3limit, &limit)!=0 || limit<=0) + if(fixup_get_ivalue(msg, (gparam_t*)p3limit, &limit)!=0 || limit<0) { - LM_ERR("invalid limit value\n"); + LM_ERR("invalid limit value: %d\n", limit); return -1; }
@@ -645,7 +645,7 @@ static int w_pl_check3(struct sip_msg* msg, char *p1pipe, char *p2alg, return -1; }
- pipe = pl_pipe_get(&pipeid, 0); + pipe = pl_pipe_get(&pipeid, 1); if(pipe==NULL) { LM_DBG("pipe not found [%.*s] - trying to add it\n", @@ -663,6 +663,9 @@ static int w_pl_check3(struct sip_msg* msg, char *p1pipe, char *p2alg, pipeid.len, pipeid.s); return -2; } + } else { + if(limit>0) pipe->limit = limit; + pl_pipe_release(&pipe->name); }
return pl_check(msg, &pipeid);
Thank you, Daniel! This works very well.
On 10/30/2014 05:31 PM, Daniel-Constantin Mierla wrote:
Module: sip-router Branch: master Commit: 280f947eac5c66bfa6151c75983ffa9e533dd709 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=280f947e...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Thu Oct 30 22:29:01 2014 +0100
pipelimit: update the limit of pipe for pl_check(pipeid, alg, limit)
- affects the dynamic pipes that could have been created by same function on a previous execution, allowing to be on-the-fly updated
- reported by Alex Balashov
modules/pipelimit/pipelimit.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules/pipelimit/pipelimit.c b/modules/pipelimit/pipelimit.c index 3e6b918..a060df7 100644 --- a/modules/pipelimit/pipelimit.c +++ b/modules/pipelimit/pipelimit.c @@ -625,9 +625,9 @@ static int w_pl_check3(struct sip_msg* msg, char *p1pipe, char *p2alg, if(msg==NULL) return -1;
- if(fixup_get_ivalue(msg, (gparam_t*)p3limit, &limit)!=0 || limit<=0)
- if(fixup_get_ivalue(msg, (gparam_t*)p3limit, &limit)!=0 || limit<0) {
LM_ERR("invalid limit value\n");
return -1; }LM_ERR("invalid limit value: %d\n", limit);
@@ -645,7 +645,7 @@ static int w_pl_check3(struct sip_msg* msg, char *p1pipe, char *p2alg, return -1; }
- pipe = pl_pipe_get(&pipeid, 0);
- pipe = pl_pipe_get(&pipeid, 1); if(pipe==NULL) { LM_DBG("pipe not found [%.*s] - trying to add it\n",
@@ -663,6 +663,9 @@ static int w_pl_check3(struct sip_msg* msg, char *p1pipe, char *p2alg, pipeid.len, pipeid.s); return -2; }
} else {
if(limit>0) pipe->limit = limit;
pl_pipe_release(&pipe->name);
}
return pl_check(msg, &pipeid);
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Daniel,
Is there any way I can persuade you to backport this to the 4.2 head?
On 11/02/2014 03:28 PM, Alex Balashov wrote:
Thank you, Daniel! This works very well.
On 10/30/2014 05:31 PM, Daniel-Constantin Mierla wrote:
Module: sip-router Branch: master Commit: 280f947eac5c66bfa6151c75983ffa9e533dd709 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=280f947e...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Thu Oct 30 22:29:01 2014 +0100
pipelimit: update the limit of pipe for pl_check(pipeid, alg, limit)
- affects the dynamic pipes that could have been created by same function on a previous execution, allowing to be on-the-fly updated
- reported by Alex Balashov
modules/pipelimit/pipelimit.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules/pipelimit/pipelimit.c b/modules/pipelimit/pipelimit.c index 3e6b918..a060df7 100644 --- a/modules/pipelimit/pipelimit.c +++ b/modules/pipelimit/pipelimit.c @@ -625,9 +625,9 @@ static int w_pl_check3(struct sip_msg* msg, char *p1pipe, char *p2alg, if(msg==NULL) return -1;
- if(fixup_get_ivalue(msg, (gparam_t*)p3limit, &limit)!=0 || limit<=0)
- if(fixup_get_ivalue(msg, (gparam_t*)p3limit, &limit)!=0 || limit<0) {
LM_ERR("invalid limit value\n");
LM_ERR("invalid limit value: %d\n", limit); return -1; }
@@ -645,7 +645,7 @@ static int w_pl_check3(struct sip_msg* msg, char *p1pipe, char *p2alg, return -1; }
- pipe = pl_pipe_get(&pipeid, 0);
- pipe = pl_pipe_get(&pipeid, 1); if(pipe==NULL) { LM_DBG("pipe not found [%.*s] - trying to add it\n",
@@ -663,6 +663,9 @@ static int w_pl_check3(struct sip_msg* msg, char *p1pipe, char *p2alg, pipeid.len, pipeid.s); return -2; }
} else {
if(limit>0) pipe->limit = limit;
pl_pipe_release(&pipe->name); } return pl_check(msg, &pipeid);
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev