Преглед на файлове

- remove unused code
- correct indention and make code more readable
(cherry picked from commit 9eacaacb45fe700615ac94cc3944824f1b22fdc4)

root преди 15 години
родител
ревизия
1ab44045e9
променени са 1 файла, в които са добавени 21 реда и са изтрити 25 реда
  1. 21 25
      modules_k/siputils/contact_ops.c

+ 21 - 25
modules_k/siputils/contact_ops.c

@@ -160,40 +160,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;
 }