[sr-dev] git:3.3: app_python: Bugfix for rewrite_ruri (backport from 4.x)
Daniel-Constantin Mierla
miconda at gmail.com
Mon Feb 25 14:46:02 CET 2013
Hello,
just wanted to point that if you do a backport, the preferred way is to use:
git cherry-pick -x _COMMITHASH_
like:
git cherry-pick -x fdf285621eee4f5c78def8ca824a9f8d53dd286b
This might not be possible for everything (e.g., modules that were
relocated from modules_k/ to modules/), but have it in mind to use it
whenever possible. Using cherry-pick is easier to spot backported
commits, because of reference by commit id.
Cheers,
Daniel
On 2/25/13 2:42 PM, Konstantin Mosesov wrote:
> Module: sip-router
> Branch: 3.3
> Commit: fdf285621eee4f5c78def8ca824a9f8d53dd286b
> URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fdf285621eee4f5c78def8ca824a9f8d53dd286b
>
> Author: Konstantin Mosesov <ez at voipgroup.org.ua>
> Committer: Konstantin Mosesov <ez at voipgroup.org.ua>
> Date: Mon Feb 25 15:35:19 2013 +0200
>
> app_python: Bugfix for rewrite_ruri (backport from 4.x)
>
> *) Fixed a bug in msg_rewrite_ruri discovered by "V Tone" <vtone001 at gmail.com>.
> *) Removed 'python exception' when do_action returns error. Reason: it is not an exception.
> *) Removed abort() if first_line type is invalid.
>
> ---
>
> modules/app_python/python_msgobj.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/modules/app_python/python_msgobj.c b/modules/app_python/python_msgobj.c
> index 3e4a2cd..0cec77c 100644
> --- a/modules/app_python/python_msgobj.c
> +++ b/modules/app_python/python_msgobj.c
> @@ -106,14 +106,13 @@ msg_rewrite_ruri(msgobject *self, PyObject *args)
> memset(&act, '\0', sizeof(act));
>
> act.type = SET_URI_T;
> - act.val[0].type = STR_ST;
> + act.val[0].type = STRING_ST;
> act.val[0].u.str.s = ruri;
> act.val[0].u.str.len = strlen(ruri);
>
> init_run_actions_ctx(&ra_ctx);
> if (do_action(&ra_ctx, &act, self->msg) < 0) {
> LM_ERR("Error in do_action\n");
> - PyErr_SetString(PyExc_RuntimeError, "Error in do_action\n");
> }
>
> Py_INCREF(Py_None);
> @@ -312,6 +311,7 @@ msg_getType(msgobject *self, PyObject *unused)
> }
>
> switch ((self->msg->first_line).type) {
> +
> case SIP_REQUEST:
> rval = "SIP_REQUEST";
> break;
> @@ -321,8 +321,9 @@ msg_getType(msgobject *self, PyObject *unused)
> break;
>
> default:
> - /* Shouldn't happen */
> - abort();
> + rval = "SIP_INVALID";
> + break;
> +
> }
> return PyString_FromString(rval);
> }
>
>
> _______________________________________________
> 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/miconda
Kamailio World Conference, April 16-17, 2013, Berlin
- http://conference.kamailio.com -
More information about the sr-dev
mailing list