From 8432e60d3fa90e5bb4abf49607fdeca3fa8a19ba Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 10 Mar 2011 16:27:12 +0100 Subject: [PATCH] Obey pz:extra_args for each search Set ZOOM option extraArgs before search and not when connection is made. This fixes a problem if same target is used with different pz:extra_args. --- src/client.c | 4 ++++ src/connection.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client.c b/src/client.c index a30355b..832eb3b 100644 --- a/src/client.c +++ b/src/client.c @@ -667,6 +667,7 @@ void client_start_search(struct client *cl) const char *opt_sru = session_setting_oneval(sdb, PZ_SRU); const char *opt_sort = session_setting_oneval(sdb, PZ_SORT); const char *opt_preferred = session_setting_oneval(sdb, PZ_PREFERRED); + const char *extra_args = session_setting_oneval(sdb, PZ_EXTRA_ARGS); char maxrecs_str[24], startrecs_str[24]; assert(link); @@ -675,6 +676,9 @@ void client_start_search(struct client *cl) cl->record_offset = 0; cl->diagnostic = 0; + if (extra_args && *extra_args) + ZOOM_connection_option_set(link, "extraArgs", extra_args); + if (opt_preferred) { cl->preferred = atoi(opt_preferred); if (cl->preferred) diff --git a/src/connection.c b/src/connection.c index 3ef5cf6..012d994 100644 --- a/src/connection.c +++ b/src/connection.c @@ -393,7 +393,6 @@ static int connection_connect(struct connection *con, iochan_man_t iochan_man) const char *charset; const char *sru; const char *sru_version = 0; - const char *extra_args = 0; struct session_database *sdb = client_get_database(con->client); const char *zproxy = session_setting_oneval(sdb, PZ_ZPROXY); @@ -424,9 +423,6 @@ static int connection_connect(struct connection *con, iochan_man_t iochan_man) if ((sru_version = session_setting_oneval(sdb, PZ_SRU_VERSION)) && *sru_version) ZOOM_options_set(zoptions, "sru_version", sru_version); - if ((extra_args = session_setting_oneval(sdb, PZ_EXTRA_ARGS)) && *extra_args) - ZOOM_options_set(zoptions, "extraArgs", extra_args); - if (!(link = ZOOM_connection_create(zoptions))) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "Failed to create ZOOM Connection"); -- 1.7.10.4