Browse code

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

root authored on 30/12/2009 13:25:01
Showing 1 changed files
... ...
@@ -168,40 +168,36 @@ decode_contact (struct sip_msg *msg,char *unused1,char *unused2)
168 168
 			separator = contact_flds_separator[0];
169 169
 		
170 170
 	if ((msg->new_uri.s == NULL) || (msg->new_uri.len == 0))
171
-		{
171
+	{
172 172
 		uri = msg->first_line.u.request.uri;
173
-		if (uri.s == NULL) return -1;
174
-		}
173
+		if (uri.s == NULL) 
174
+			return -1;
175
+	}
175 176
 	
176
-		res = decode_uri (uri, separator, &newUri);
177
+	res = decode_uri (uri, separator, &newUri);
177 178
 	
178 179
 #ifdef DEBUG
179
-		if (res == 0) fprintf (stdout, "newuri.s=[%.*s]\n", newUri.len, newUri.s);
180
+	if (res == 0) 
181
+		fprintf (stdout, "newuri.s=[%.*s]\n", newUri.len, newUri.s);
180 182
 #endif
181
-		if (res != 0)
182
-		{
183
-			LM_ERR("failed decoding contact.Code %d\n", res);
183
+	if (res != 0)
184
+	{
185
+		LM_ERR("failed decoding contact.Code %d\n", res);
184 186
 #ifdef STRICT_CHECK
185
-				return res;
187
+		return res;
186 188
 #endif
187
-		}
189
+	}
190
+	else
191
+	{
192
+		/* we do not modify the original first line */
193
+		if ((msg->new_uri.s == NULL) || (msg->new_uri.len == 0)) 
194
+			msg->new_uri = newUri;
188 195
 		else
189
-			/* we do not modify the original first line */
190
-			if ((msg->new_uri.s == NULL) || (msg->new_uri.len == 0)) msg->new_uri = newUri;
191
-				else
192
-					{
193
-						pkg_free(msg->new_uri.s);
194
-						msg->new_uri = newUri;
195
-					}
196
-			
197
-			
198
-		/*
199
-		if (patch (msg, uri.s, uri.len, newUri.s, newUri.len) < 0)
200 196
 		{
201
-			LM_ERR("lumping failed in mangling port \n");
202
-			return -2;
203
-		}
204
-		*/
197
+			pkg_free(msg->new_uri.s);
198
+			msg->new_uri = newUri;
199
+		}		
200
+	}
205 201
 	return 1;
206 202
 }
207 203