From a814293e9287584c9f16e772dc3710a590091bd9 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 19 Oct 2009 16:50:57 +0200 Subject: [PATCH] Fix Host header for SRU/SRW - bug #3069 --- src/connection.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/connection.c b/src/connection.c index 7b0a027..7496a1c 100644 --- a/src/connection.c +++ b/src/connection.c @@ -346,7 +346,6 @@ static int connection_connect(struct connection *con) const char *auth; const char *sru; const char *sru_version = 0; - char ipport[512] = ""; struct session_database *sdb = client_get_database(con->client); const char *zproxy = session_setting_oneval(sdb, PZ_ZPROXY); @@ -382,10 +381,14 @@ static int connection_connect(struct connection *con) } if (sru && *sru) - strcpy(ipport, "http://"); - strcat(ipport, host->ipport); - - ZOOM_connection_connect(link, ipport, 0); + { + char http_hostport[512]; + strcpy(http_hostport, "http://"); + strcat(http_hostport, host->hostport); + ZOOM_connection_connect(link, http_hostport, 0); + } + else + ZOOM_connection_connect(link, host->ipport, 0); con->link = link; con->iochan = iochan_create(0, connection_handler, 0); -- 1.7.10.4