From 31f59d18703e1543b0d1432ebf59d3fd0c68f1af Mon Sep 17 00:00:00 2001 From: Thomas Ries Date: Sun, 27 Jun 2004 21:35:54 +0000 Subject: [PATCH] - fix: in some configurations incoming requests could be sent to a wrong port number. --- ChangeLog | 5 +++++ src/proxy.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c3cd0f..4039e80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +0.5.8 +===== + 27-Jun-2004: - fix: in some configurations incoming requests could + be sent to a wrong port number. + 0.5.7 ===== 24-Jun-2004: - Released 0.5.7 diff --git a/src/proxy.c b/src/proxy.c index 83549b3..cedb923 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1267,8 +1267,8 @@ int proxy_rewrite_request_uri(osip_message_t *mymsg, int idx){ url=osip_message_get_uri(mymsg); /* set the true host */ - if(urlmap[idx].true_url->host) { - osip_free(url->host);url->host=NULL; + if (url->host) osip_free(url->host);url->host=NULL; + if (urlmap[idx].true_url->host) { DEBUGC(DBCLASS_BABBLE,"proxy_rewrite_request_uri: host=%s", urlmap[idx].true_url->host); host = (char *)malloc(strlen(urlmap[idx].true_url->host)+1); @@ -1278,8 +1278,8 @@ int proxy_rewrite_request_uri(osip_message_t *mymsg, int idx){ } /* set the true port */ - if(urlmap[idx].true_url->port) { - osip_free(url->port);url->port=NULL; + if (url->port) osip_free(url->port);url->port=NULL; + if (urlmap[idx].true_url->port) { DEBUGC(DBCLASS_BABBLE,"proxy_rewrite_request_uri: port=%s", urlmap[idx].true_url->port); port = (char *)malloc(strlen(urlmap[idx].true_url->port)+1);