The following patch fixes a problem seen in the Route headers of
an ACK when the first proxy in the route set is not loose-routing.
The problem may also be seen in other requests within the dialog.
It also addresses some apparent memory leaks.
The patch is relative to linphone-0.11.0, but the function
(dialog_fill_route_set) appears to be the same in 0.12.0
and the patch should apply there too.
-troy
------------------------------------------------------------------------
diff -Naur src/osipdialog.c new/osipdialog.c
--- src/osipdialog.c 2003-10-28 10:03:07.000000000 -0500
+++ new/osipdialog.c 2003-10-28 09:53:38.000000000 -0500
@@ -991,19 +991,16 @@
* with bis-08) then the rquri should contains the remote target
* URI */
int i;
- int pos = 0;
+ int pos = 0, first = 0 ;
url_param_t *lr_param;
route_t *route;
char *last_route;
/* AMD bug: fixed 17/06/2002 */
+ /* The route_set is stored backwards in CALLER */
if (dialog->type == CALLER)
- {
- pos = list_size (dialog->route_set) - 1;
- route = (route_t *) list_get (dialog->route_set, pos);
- }
- else
- route = (route_t *) list_get (dialog->route_set, 0);
+ first = list_size (dialog->route_set) - 1;
+ route = (route_t *) list_get (dialog->route_set, first);
url_uparam_getbyname (route->url, "lr", &lr_param);
if (lr_param != NULL) /* the remote target URI is the rquri! */
@@ -1053,13 +1050,17 @@
return -1;
if (dialog->type == CALLER)
{
- if (pos != 0)
+ if (pos != first)
list_add (request->routes, route2, 0);
+ else
+ route_free(route2);
}
else
{
if (!list_eol (dialog->route_set, pos + 1))
list_add (request->routes, route2, -1);
+ else
+ route_free(route2);
}
pos++;
}
------------------------------------------------------------------------
_______________________________________________
Linphone-developers mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/linphone-developers