This commit is contained in:
Thomas Ries
2015-07-17 09:19:16 +00:00
parent 5d8bb91b8f
commit 22c97a4398
3 changed files with 4 additions and 53 deletions
-52
View File
@@ -1181,10 +1181,6 @@ if (configuration.debuglevel)
* STS_SUCCESS on success
*/
int proxy_rewrite_request_uri(osip_message_t *mymsg, int idx){
char *scheme;
char *username;
char *host;
char *port;
osip_uri_t *url;
int sts;
char *tmp1=NULL;
@@ -1198,53 +1194,6 @@ int proxy_rewrite_request_uri(osip_message_t *mymsg, int idx){
DEBUGC(DBCLASS_PROXY,"rewriting incoming Request URI");
url=osip_message_get_uri(mymsg);
#if 0
/* set the true scheme */
if (url->scheme) {osip_free(url->scheme);url->scheme=NULL;}
if (urlmap[idx].true_url->scheme) {
DEBUGC(DBCLASS_BABBLE,"proxy_rewrite_request_uri: scheme=%s",
urlmap[idx].true_url->scheme);
scheme = (char *)osip_malloc(strlen(urlmap[idx].true_url->scheme)+1);
memcpy(scheme, urlmap[idx].true_url->scheme,
strlen(urlmap[idx].true_url->scheme));
scheme[strlen(urlmap[idx].true_url->scheme)]='\0';
osip_uri_set_scheme(url, scheme);
}
/* set the true username */
if (url->username) {osip_free(url->username);url->username=NULL;}
if (urlmap[idx].true_url->username) {
DEBUGC(DBCLASS_BABBLE,"proxy_rewrite_request_uri: username=%s",
urlmap[idx].true_url->username);
username = (char*)osip_malloc(strlen(urlmap[idx].true_url->username)+1);
memcpy(username, urlmap[idx].true_url->username,
strlen(urlmap[idx].true_url->username));
username[strlen(urlmap[idx].true_url->username)]='\0';
osip_uri_set_username(url, username);
}
/* set the true host */
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 *)osip_malloc(strlen(urlmap[idx].true_url->host)+1);
memcpy(host, urlmap[idx].true_url->host, strlen(urlmap[idx].true_url->host));
host[strlen(urlmap[idx].true_url->host)]='\0';
osip_uri_set_host(url, host);
}
/* set the true port */
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 *)osip_malloc(strlen(urlmap[idx].true_url->port)+1);
memcpy(port, urlmap[idx].true_url->port, strlen(urlmap[idx].true_url->port));
port[strlen(urlmap[idx].true_url->port)]='\0';
osip_uri_set_port(url, port);
}
#else
osip_uri_to_str(url, &tmp1);
osip_uri_to_str(urlmap[idx].true_url, &tmp2);
DEBUGC(DBCLASS_BABBLE,"proxy_rewrite_request_uri: %s -> %s", tmp1, tmp2);
@@ -1257,7 +1206,6 @@ int proxy_rewrite_request_uri(osip_message_t *mymsg, int idx){
ERROR("osip_uri_clone failed");
}
osip_message_set_uri(mymsg, url);
#endif
return STS_SUCCESS;
}