From: Sebastian Hammer Date: Tue, 22 Jul 2008 12:27:14 +0000 (+0000) Subject: Enabled basic SRU support -- no CQL yet X-Git-Tag: v1.1.0~138^2 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=4014c2edcb681e0714ef2a7a91069d9c905056af;p=pazpar2-moved-to-github.git Enabled basic SRU support -- no CQL yet --- diff --git a/src/connection.c b/src/connection.c index 197dbcb..e66ee72 100644 --- a/src/connection.c +++ b/src/connection.c @@ -352,6 +352,8 @@ int connection_connect(struct connection *con) struct host *host = connection_get_host(con); ZOOM_options zoptions = ZOOM_options_create(); char *auth; + char *sru; + char ipport[512] = ""; struct session_database *sdb = client_get_database(con->client); const char *zproxy = session_setting_oneval(sdb, PZ_ZPROXY); @@ -375,6 +377,8 @@ int connection_connect(struct connection *con) if ((auth = (char*) session_setting_oneval(sdb, PZ_AUTHENTICATION))) ZOOM_options_set(zoptions, "user", auth); + if ((sru = (char*) session_setting_oneval(sdb, PZ_SRU)) && *sru) + ZOOM_options_set(zoptions, "sru", sru); if (!(link = ZOOM_connection_create(zoptions))) { @@ -382,7 +386,12 @@ int connection_connect(struct connection *con) ZOOM_options_destroy(zoptions); return -1; } - ZOOM_connection_connect(link, host->ipport, 0); + + if (sru && *sru) + strcpy(ipport, "http://"); + strcat(ipport, host->ipport); + + ZOOM_connection_connect(link, ipport, 0); con->link = link; con->iochan = iochan_create(0, connection_handler, 0); diff --git a/src/settings.c b/src/settings.c index bea5da7..694cddf 100644 --- a/src/settings.c +++ b/src/settings.c @@ -63,6 +63,7 @@ static char *hard_settings[] = { "pz:ip", "pz:zproxy", "pz:apdulog", + "pz:sru", 0 }; diff --git a/src/settings.h b/src/settings.h index 65e77b2..08411ac 100644 --- a/src/settings.h +++ b/src/settings.h @@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define PZ_IP 12 #define PZ_ZPROXY 13 #define PZ_APDULOG 14 - +#define PZ_SRU 15 struct setting {