Extended comstack with outgoing IP YAZ-795
[yaz-moved-to-github.git] / src / comstack.c
index d364f05..ee64fc8 100644 (file)
@@ -175,8 +175,8 @@ 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)
+COMSTACK cs_create_host2(const char *vhost, int blocking, void **vp,
+                         const char *proxy_host, const char *bind_host)
 {
     enum oid_proto proto = PROTO_Z3950;
     const char *host = 0;
@@ -198,7 +198,8 @@ COMSTACK cs_create_host_proxy(const char *vhost, int blocking, void **vp,
 
     if (t == tcpip_type)
     {
-        cs = yaz_tcpip_create(-1, blocking, proto, connect_host ? host : 0);
+        cs = yaz_tcpip_create2(-1, blocking, proto, connect_host ? host : 0,
+                               bind_host);
     }
     else
     {
@@ -216,6 +217,12 @@ COMSTACK cs_create_host_proxy(const char *vhost, int blocking, void **vp,
     return cs;
 }
 
+COMSTACK cs_create_host_proxy(const char *vhost, int blocking, void **vp,
+                              const char *proxy_host)
+{
+    return cs_create_host2(vhost, blocking, vp, proxy_host, 0);
+}
+
 int cs_look (COMSTACK cs)
 {
     return cs->event;