X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fdatabase.c;h=f3225ee1f9d96d0c73ecf95c6d342b26ae897539;hb=1922e9b86a79d3bc536c3093afd3787d8a6c9194;hp=ab6fa8b81345e74683d08b79f1b508ac54d1867b;hpb=ed85e16a01bf34b07024bfed050584f8e4bfbf15;p=pazpar2-moved-to-github.git diff --git a/src/database.c b/src/database.c index ab6fa8b..f3225ee 100644 --- a/src/database.c +++ b/src/database.c @@ -1,4 +1,4 @@ -/* $Id: database.c,v 1.15 2007-04-11 19:55:57 quinn Exp $ +/* $Id: database.c,v 1.16 2007-04-12 07:15:48 marc Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -126,7 +126,7 @@ static struct host *find_host(const char *hostport) static struct database *load_database(const char *id) { - xmlDoc *doc = get_explain_xml(id); + xmlDoc *doc = 0; struct zr_explain *explain = 0; struct database *db; struct host *host; @@ -136,12 +136,15 @@ static struct database *load_database(const char *id) yaz_log(YLOG_LOG, "New database: %s", id); if (!nmem) nmem = nmem_create(); - if (doc) + + if (config && config->targetprofiles + && (doc = get_explain_xml(id))) { explain = zr_read_xml(nmem, xmlDocGetRootElement(doc)); if (!explain) return 0; } + if (strlen(id) > 255) return 0; strcpy(hostport, id);