From 9366228f57d16bb1c66f1762a2a094d17bc8b02c Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 2 Sep 2008 11:19:07 +0200 Subject: [PATCH] Fixes for URL path not being propagated for SRU requests --- src/client.c | 5 ++--- src/connection.c | 13 ++++++++++--- src/database.c | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/client.c b/src/client.c index daf5f57..37cef18 100644 --- a/src/client.c +++ b/src/client.c @@ -466,9 +466,8 @@ void client_start_search(struct client *cl) sprintf(n, "%d", global_parameters.toget); ZOOM_connection_option_set(link, "count", n); } - if (!databaseName || !*databaseName) - databaseName = "Default"; - ZOOM_connection_option_set(link, "databaseName", databaseName); + if (databaseName) + ZOOM_connection_option_set(link, "databaseName", databaseName); ZOOM_connection_option_set(link, "presentChunk", "20"); diff --git a/src/connection.c b/src/connection.c index 08d80e6..32bafb5 100644 --- a/src/connection.c +++ b/src/connection.c @@ -135,10 +135,8 @@ static void remove_connection_from_host(struct connection *con) void connection_continue(struct connection *co) { -#if 1 yaz_log(YLOG_LOG, "connection_continue"); iochan_setevent(co->iochan, EVENT_OUTPUT); -#endif } // Close connection and recycle structure @@ -391,7 +389,16 @@ int connection_connect(struct connection *con) if (sru && *sru) strcpy(ipport, "http://"); strcat(ipport, host->ipport); - + /* deal with SRU path here because databaseName option is not read in + ZOOM in SRU mode */ + if (sru && *sru) + { + if (*sdb->database->databases[0]) + { + strcat(ipport, "/"); + strcat(ipport, sdb->database->databases[0]); + } + } ZOOM_connection_connect(link, ipport, 0); con->link = link; diff --git a/src/database.c b/src/database.c index 9069791..fab9249 100644 --- a/src/database.c +++ b/src/database.c @@ -134,7 +134,7 @@ static struct database *load_database(const char *id) if ((dbname = strchr(hostport, '/'))) *(dbname++) = '\0'; else - dbname = "Default"; + dbname = ""; if (!(host = find_host(hostport))) return 0; db = nmem_malloc(nmem, sizeof(*db)); -- 1.7.10.4