X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;fp=client%2Fclient.c;h=d64884c04e6500eb0f9c287fa4627df74766daf2;hb=06485f9b118b91d56e88e412ba54ce43fae9d0b8;hp=596b76ad9fe0c4ad8075c5ef0945e5eeae8c7c51;hpb=ad254547a6fc4d5dddbdf09e97b7c8ee38c8f0aa;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index 596b76a..d64884c 100644 --- a/client/client.c +++ b/client/client.c @@ -151,6 +151,7 @@ static Odr_int last_hit_count = 0; static int pretty_xml = 0; static Odr_int sru_maximumRecords = 0; static yaz_cookies_t yaz_cookies = 0; +static char *bind_host = 0; typedef enum { QueryType_Prefix, @@ -703,7 +704,7 @@ static int session_connect_base(const char *arg, const char **basep) strncpy(type_and_host, arg, sizeof(type_and_host)-1); type_and_host[sizeof(type_and_host)-1] = '\0'; - conn = cs_create_host_proxy(arg, 1, &add, yazProxy); + conn = cs_create_host2(arg, 1, &add, yazProxy, bind_host); if (!conn) { printf("Could not resolve address %s\n", arg); @@ -755,6 +756,15 @@ static int session_connect(void) return r; } +static int cmd_bind(const char *arg) +{ + xfree(bind_host); + bind_host = 0; + if (arg && *arg) + bind_host = xstrdup(arg); + return 0; +} + static int cmd_open(const char *arg) { int r; @@ -5051,6 +5061,7 @@ static struct { {"init", cmd_init, "", NULL,0,NULL}, {"sru", cmd_sru, " ", NULL,0,NULL}, {"url", cmd_url, "", NULL,0,NULL}, + {"bind", cmd_bind, "", NULL,0,NULL}, {"exit", cmd_quit, "",NULL,0,NULL}, {0,0,0,0,0,0} };