X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fcomstack.c;h=74faf5ca3c728307909e18bfc00be0f2b47ec6fe;hb=3c287bc1d48ee6a1f300054c2cebd0ba312bd5b9;hp=669117dc2ef080d8790888978af8c18e509a3bc4;hpb=4f3bcae93d51a26709c12b51261c3d95af610cb2;p=yaz-moved-to-github.git diff --git a/src/comstack.c b/src/comstack.c index 669117d..74faf5c 100644 --- a/src/comstack.c +++ b/src/comstack.c @@ -157,13 +157,20 @@ static int cs_parse_host(const char *uri, const char **host, COMSTACK cs_create_host(const char *vhost, int blocking, void **vp) { + return cs_create_host_proxy(vhost, blocking, vp, 0); +} + +COMSTACK cs_create_host_proxy(const char *vhost, int blocking, void **vp, + const char *proxy_host) +{ enum oid_proto proto = PROTO_Z3950; const char *host = 0; COMSTACK cs; CS_TYPE t; char *connect_host = 0; - cs_parse_host(vhost, &host, &t, &proto, &connect_host); + if (!cs_parse_host(vhost, &host, &t, &proto, &connect_host)) + return 0; if (t == tcpip_type) { @@ -175,6 +182,8 @@ COMSTACK cs_create_host(const char *vhost, int blocking, void **vp) } if (cs) { + if (proxy_host) + host = proxy_host; if (!(*vp = cs_straddr(cs, connect_host ? connect_host : host))) { cs_close (cs);