Module: sip-router Branch: master Commit: 9efc7014638e2c7ead56ac36d880b303f2873b85 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9efc7014...
Author: Juha Heinanen jh@tutpro.com Committer: Juha Heinanen jh@tutpro.com Date: Mon Aug 8 10:55:24 2011 +0300
modules/tm: t_load_contacts() now ignores ruri if it has already been used - Thanks to Alex Hermann for the patch.
---
modules/tm/t_serial.c | 49 ++++++++++++++++++++++++++++++++----------------- 1 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/modules/tm/t_serial.c b/modules/tm/t_serial.c index 899cb5b..bd5ae27 100644 --- a/modules/tm/t_serial.c +++ b/modules/tm/t_serial.c @@ -242,15 +242,21 @@ int t_load_contacts(struct sip_msg* msg, char* key, char* value) }
ruri = (str *)0; - - /* Take first q from Request-URI */ - ruri = GET_RURI(msg); - if (!ruri) { - LM_ERR("no Request-URI found\n"); - return -1; + if (ruri_is_new) { + /* Take first q from Request-URI */ + ruri = GET_RURI(msg); + if (!ruri) { + LM_ERR("no Request-URI found\n"); + return -1; + } + first_q = get_ruri_q(); + first_idx = 0; + } else { + /* Take first q from first branch */ + uri.s = get_branch(0, &uri.len, &first_q, &dst_uri, &path, &flags, + &sock); + first_idx = 1; } - first_q = get_ruri_q(); - first_idx = 0;
/* Check if all q values are equal */ for(idx = first_idx; (tmp.s = get_branch(idx, &tmp.len, &q, 0, 0, 0, 0)) @@ -272,15 +278,24 @@ rest: return -1; }
- /* Insert Request-URI branch to first contact */ - contacts->uri.s = ruri->s; - contacts->uri.len = ruri->len; - contacts->dst_uri = msg->dst_uri; - contacts->sock = msg->force_send_socket; - getbflagsval(0, &contacts->flags); - contacts->path = msg->path_vec; - contacts->q = first_q; - contacts->next = (struct contact *)0; + if (ruri_is_new) { + /* Insert Request-URI branch to first contact */ + contacts->uri.s = ruri->s; + contacts->uri.len = ruri->len; + contacts->dst_uri = msg->dst_uri; + contacts->sock = msg->force_send_socket; + getbflagsval(0, &contacts->flags); + contacts->path = msg->path_vec; + } else { + /* Insert first branch to first contact */ + contacts->uri = uri; + contacts->dst_uri = dst_uri; + contacts->sock = sock; + contacts->flags = flags; + contacts->path = path; + } + contacts->q = first_q; + contacts->next = (struct contact *)0;
/* Insert (remaining) branches to contact list in increasing q order */
On Monday 08 August 2011, Juha Heinanen wrote:
Author: Juha Heinanen jh@tutpro.com
WTF?
You can't do this. Besides being illegal, this is highly unethical. You can't take code from me and claim authorship. Being asked to review a patch is not a permit to run away with it.
Committing the patch unaltered would be acceptable but still weird given the text accompanying the patch.
Committer: Juha Heinanen jh@tutpro.com Date: Mon Aug 8 10:55:24 2011 +0300 a modules/tm: t_load_contacts() now ignores ruri if it has already been used
- Thanks to Alex Hermann for the patch.
That's about the same as taking a car from a dealer for a testdrive and keeping if afterwards with a note to the dealer saying thanks.
Alex Hermann writes:
You can't do this. Besides being illegal, this is highly unethical. You can't take code from me and claim authorship. Being asked to review a patch is not a permit to run away with it.
sorry for the misunderstanding. i though you wanted me to review and commit the patch. i'll try if i can revert it somehow.
-- juha
On Monday 08 August 2011, Juha Heinanen wrote:
Alex Hermann writes:
You can't do this. Besides being illegal, this is highly unethical. You can't take code from me and claim authorship. Being asked to review a patch is not a permit to run away with it.
sorry for the misunderstanding. i though you wanted me to review and commit the patch. i'll try if i can revert it somehow.
To avoid making a mess of the repository, let's just keep this one in. I hope it won't happen again though.
On Monday 08 August 2011, Alex Hermann wrote:
On Monday 08 August 2011, Juha Heinanen wrote:
Alex Hermann writes:
You can't do this. Besides being illegal, this is highly unethical. You can't take code from me and claim authorship. Being asked to review a patch is not a permit to run away with it.
sorry for the misunderstanding. i though you wanted me to review and commit the patch. i'll try if i can revert it somehow.
To avoid making a mess of the repository, let's just keep this one in. I hope it won't happen again though.
Hi Alex,
Juha has reverted the commit in master and 3.1 branch. These practice with giving credits to the author for smaller patches from non-commiters in the description is used a lot, probably you've seen it before. In this particiular case, as you also have commit rights you can of course just commit the patch by yourself.
Git provides an distinction between "author" - the persion who wrote the patch, and "commiter" - the one who just upload it to. Its just not that widely used here , as people are still used to the SVN workflow, which is of course fine.
Best regards,
Henning