From 71476ea82ec3589d3450e9cd778691822e8f2751 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 2 Sep 2008 12:28:30 +0200 Subject: [PATCH] Added setting sru_version which allows SRU version to be set --- doc/pazpar2_conf.xml | 11 +++++++++++ etc/sru-test.xml | 1 + src/connection.c | 12 ++++++++---- src/settings.c | 1 + src/settings.h | 1 + 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/doc/pazpar2_conf.xml b/doc/pazpar2_conf.xml index e6e4a90..44a9935 100644 --- a/doc/pazpar2_conf.xml +++ b/doc/pazpar2_conf.xml @@ -809,6 +809,17 @@ + + + pz:sru_version + + + This allows SRU version to be specified. If unset Pazpar2 + will the default of YAZ (currently 1.2). Should be set + to 1.1 or 1.2. + + + diff --git a/etc/sru-test.xml b/etc/sru-test.xml index 9cc3f99..1020e1a 100644 --- a/etc/sru-test.xml +++ b/etc/sru-test.xml @@ -3,6 +3,7 @@ + diff --git a/src/connection.c b/src/connection.c index 32bafb5..f2b48e4 100644 --- a/src/connection.c +++ b/src/connection.c @@ -350,8 +350,9 @@ int connection_connect(struct connection *con) ZOOM_connection link = 0; struct host *host = connection_get_host(con); ZOOM_options zoptions = ZOOM_options_create(); - char *auth; - char *sru; + const char *auth; + const char *sru; + const char *sru_version = 0; char ipport[512] = ""; struct session_database *sdb = client_get_database(con->client); @@ -374,10 +375,13 @@ int connection_connect(struct connection *con) if (apdulog && *apdulog) ZOOM_options_set(zoptions, "apdulog", apdulog); - if ((auth = (char*) session_setting_oneval(sdb, PZ_AUTHENTICATION))) + if ((auth = session_setting_oneval(sdb, PZ_AUTHENTICATION))) ZOOM_options_set(zoptions, "user", auth); - if ((sru = (char*) session_setting_oneval(sdb, PZ_SRU)) && *sru) + if ((sru = session_setting_oneval(sdb, PZ_SRU)) && *sru) ZOOM_options_set(zoptions, "sru", sru); + if ((sru_version = session_setting_oneval(sdb, PZ_SRU_VERSION)) + && *sru_version) + ZOOM_options_set(zoptions, "sru_version", sru_version); if (!(link = ZOOM_connection_create(zoptions))) { diff --git a/src/settings.c b/src/settings.c index 694cddf..8ab368a 100644 --- a/src/settings.c +++ b/src/settings.c @@ -64,6 +64,7 @@ static char *hard_settings[] = { "pz:zproxy", "pz:apdulog", "pz:sru", + "pz:sru_version", 0 }; diff --git a/src/settings.h b/src/settings.h index 08411ac..ca0af1f 100644 --- a/src/settings.h +++ b/src/settings.h @@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define PZ_ZPROXY 13 #define PZ_APDULOG 14 #define PZ_SRU 15 +#define PZ_SRU_VERSION 16 struct setting { -- 1.7.10.4