From: Adam Dickmeiss Date: Mon, 19 Oct 2009 14:50:57 +0000 (+0200) Subject: Fix Host header for SRU/SRW - bug #3069 X-Git-Tag: v1.2.3~14 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=a814293e9287584c9f16e772dc3710a590091bd9;p=pazpar2-moved-to-github.git Fix Host header for SRU/SRW - bug #3069 --- 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);