Module: sip-router
Branch: master
Commit: 673f3cd3d1ae721f54d1a911e92321c6733ce7f6
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=673f3cd…
Author: root <root(a)relay.labs.nic.at>
Committer: Klaus Darilion <klaus.mailinglists(a)pernau.at>
Date: Wed Dec 30 13:25:01 2009 +0000
- remove unused code
- correct indention and make code more readable
(cherry picked from commit 9eacaacb45fe700615ac94cc3944824f1b22fdc4)
---
modules_k/siputils/contact_ops.c | 46 +++++++++++++++++--------------------
1 files changed, 21 insertions(+), 25 deletions(-)
diff --git a/modules_k/siputils/contact_ops.c b/modules_k/siputils/contact_ops.c
index 82fcd35..666332c 100644
--- a/modules_k/siputils/contact_ops.c
+++ b/modules_k/siputils/contact_ops.c
@@ -168,40 +168,36 @@ decode_contact (struct sip_msg *msg,char *unused1,char *unused2)
separator = contact_flds_separator[0];
if ((msg->new_uri.s == NULL) || (msg->new_uri.len == 0))
- {
+ {
uri = msg->first_line.u.request.uri;
- if (uri.s == NULL) return -1;
- }
+ if (uri.s == NULL)
+ return -1;
+ }
- res = decode_uri (uri, separator, &newUri);
+ res = decode_uri (uri, separator, &newUri);
#ifdef DEBUG
- if (res == 0) fprintf (stdout, "newuri.s=[%.*s]\n", newUri.len, newUri.s);
+ if (res == 0)
+ fprintf (stdout, "newuri.s=[%.*s]\n", newUri.len, newUri.s);
#endif
- if (res != 0)
- {
- LM_ERR("failed decoding contact.Code %d\n", res);
+ if (res != 0)
+ {
+ LM_ERR("failed decoding contact.Code %d\n", res);
#ifdef STRICT_CHECK
- return res;
+ return res;
#endif
- }
+ }
+ else
+ {
+ /* we do not modify the original first line */
+ if ((msg->new_uri.s == NULL) || (msg->new_uri.len == 0))
+ msg->new_uri = newUri;
else
- /* we do not modify the original first line */
- if ((msg->new_uri.s == NULL) || (msg->new_uri.len == 0)) msg->new_uri =
newUri;
- else
- {
- pkg_free(msg->new_uri.s);
- msg->new_uri = newUri;
- }
-
-
- /*
- if (patch (msg, uri.s, uri.len, newUri.s, newUri.len) < 0)
{
- LM_ERR("lumping failed in mangling port \n");
- return -2;
- }
- */
+ pkg_free(msg->new_uri.s);
+ msg->new_uri = newUri;
+ }
+ }
return 1;
}