X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fconnection.c;h=9ca21424841d4cea88ebd8237bcf77e189cb4e02;hb=cab4338c5c234466d9746982005b23de99555121;hp=d3eaeefe4148fd1280aa907137938fcb6f428acd;hpb=5a6816065057859b44273d5c674371c56311a667;p=pazpar2-moved-to-github.git diff --git a/src/connection.c b/src/connection.c index d3eaeef..9ca2142 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2012 Index Data + Copyright (C) 2006-2013 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -463,13 +463,13 @@ static int connection_connect(struct connection *con, iochan_man_t iochan_man) return -1; } - if (sru && *sru) + if (sru && *sru && !strstr(host->url, "://")) { - char http_hostport[512]; - strcpy(http_hostport, "http://"); - strcat(http_hostport, host->url); - yaz_log(YLOG_LOG, "SRU connect to : %s", http_hostport); - ZOOM_connection_connect(con->link, http_hostport, 0); + WRBUF w = wrbuf_alloc(); + wrbuf_puts(w, "http://"); + wrbuf_puts(w, host->url); + ZOOM_connection_connect(con->link, wrbuf_cstr(w), 0); + wrbuf_destroy(w); } else {