/* 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
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
{