[sr-dev] git:master:10250429: dmq: do not parse From header again, since it was done already prior to cloning msg.

Daniel-Constantin Mierla miconda at gmail.com
Fri Jan 30 16:00:38 CET 2015


parse_from_header() should do nothing if the From header is found parsed. I
am not sure if this alone is solving the issue properly. Maybe the From was
not parsed in the first place, before cloning...

Cheers,
Daniel

On Fri, Jan 30, 2015 at 3:09 PM, Charles Chance <
charles.chance at sipcentric.com> wrote:

> Module: kamailio
> Branch: master
> Commit: 102504294f9edaaee9d4baea873d4ed9151b8fed
> URL:
> https://github.com/kamailio/kamailio/commit/102504294f9edaaee9d4baea873d4ed9151b8fed
>
> Author: Charles Chance <charles.chance at sipcentric.com>
> Committer: Charles Chance <charles.chance at sipcentric.com>
> Date: 2015-01-30T14:08:01Z
>
> dmq: do not parse From header again, since it was done already prior to
> cloning msg.
>
> - introduces a memory leak if not manually freed
> - but there is no need to parse it again anyway
> - discovered by Andrey Rybkin
>
> ---
>
> Modified: modules/dmq/worker.c
>
> ---
>
> Diff:
> https://github.com/kamailio/kamailio/commit/102504294f9edaaee9d4baea873d4ed9151b8fed.diff
> Patch:
> https://github.com/kamailio/kamailio/commit/102504294f9edaaee9d4baea873d4ed9151b8fed.patch
>
> ---
>
> diff --git a/modules/dmq/worker.c b/modules/dmq/worker.c
> index 8426730..ca1b3dc 100644
> --- a/modules/dmq/worker.c
> +++ b/modules/dmq/worker.c
> @@ -91,11 +91,11 @@ void worker_loop(int id)
>                         current_job = job_queue_pop(worker->queue);
>                         /* job_queue_pop might return NULL if queue is
> empty */
>                         if(current_job) {
> -                               /* extract the from uri */
> -                               if (parse_from_header(current_job->msg) <
> 0) {
> -                                       LM_ERR("bad sip message or missing
> From hdr\n");
> -                               } else {
> +                               /* attempt to identify node based on from
> uri */
> +                               if (current_job->msg->from->parsed) {
>                                         dmq_node =
> find_dmq_node_uri(node_list, &((struct
> to_body*)current_job->msg->from->parsed)->uri);
> +                               } else {
> +                                       LM_ERR("bad sip message or missing
> From hdr\n");
>                                 }
>
>                                 ret_value =
> current_job->f(current_job->msg, &peer_response, dmq_node);
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>



-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/micond
<http://www.linkedin.com/in/miconda>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20150130/f162eca8/attachment-0001.html>


More information about the sr-dev mailing list