/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data
+ * Copyright (C) 1995-2012 Index Data
* See the file LICENSE for details.
*/
/**
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)
{
}
if (cs)
{
+ if (proxy_host)
+ host = proxy_host;
if (!(*vp = cs_straddr(cs, connect_host ? connect_host : host)))
{
cs_close (cs);