From: Adam Dickmeiss Date: Tue, 2 Sep 2008 10:28:30 +0000 (+0200) Subject: Added setting sru_version which allows SRU version to be set X-Git-Tag: v1.1.0~121 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=71476ea82ec3589d3450e9cd778691822e8f2751;p=pazpar2-moved-to-github.git Added setting sru_version which allows SRU version to be set --- 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 {