+Loose the query parsing so that Pazpar2 only returns error if _all_
+query conversions fail (rather than _any_). This means targets that do
+not support some fields are ignored in a search.
+
--- 1.0.1 2007/07/03
Improved handling of socket timeout for Z39.50 connections.
-/* $Id: logic.c,v 1.47 2007-06-28 09:36:10 adam Exp $
+/* $Id: logic.c,v 1.48 2007-07-04 12:07:49 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
const char **addinfo)
{
int live_channels = 0;
+ int no_working = 0;
+ int no_failed = 0;
struct client *cl;
struct database_criterion *criteria;
*addinfo = client_get_database(cl)->database->url;
return PAZPAR2_CONFIG_TARGET;
}
- // Query must parse for all targets
+ // Parse query for target
if (client_parse_query(cl, query) < 0)
+ no_failed++;
+ else
{
- *addinfo = "query";
- return PAZPAR2_MALFORMED_PARAMETER_VALUE;
+ no_working++;
+ client_prep_connection(cl);
}
}
- for (cl = se->clients; cl; cl = client_next_in_session(cl))
- client_prep_connection(cl);
-
+ // If no queries could be mapped, we signal an error
+ if (no_working == 0)
+ {
+ *addinfo = "query";
+ return PAZPAR2_MALFORMED_PARAMETER_VALUE;
+ }
return PAZPAR2_NO_ERROR;
}