From 7cca838c3a2d3fbb017949dd44d1c7d8a19dc843 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 24 Oct 2006 08:07:02 +0000 Subject: [PATCH] Fail decoding of SRU SOAP searchRetrieveRequest if queries are omitted --- src/matchstr.c | 10 ++-------- src/seshigh.c | 5 +++-- src/srw.c | 7 ++++++- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/matchstr.c b/src/matchstr.c index b3faae7..95d767e 100644 --- a/src/matchstr.c +++ b/src/matchstr.c @@ -1,8 +1,8 @@ /* - * Copyright (C) 1995-2005, Index Data ApS + * Copyright (C) 1995-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: matchstr.c,v 1.5 2005-06-25 15:46:04 adam Exp $ + * $Id: matchstr.c,v 1.6 2006-10-24 08:07:02 adam Exp $ */ /** @@ -20,12 +20,6 @@ #include #include -/* - * Match strings, independently of case and occurences of '-'. - * fairly inefficient - will be replaced with an indexing scheme for - * the various subsystems if we get a bottleneck here. - */ - int yaz_matchstr(const char *s1, const char *s2) { while (*s1 && *s2) diff --git a/src/seshigh.c b/src/seshigh.c index 99667b9..e93ec50 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: seshigh.c,v 1.100 2006-10-05 15:24:02 adam Exp $ + * $Id: seshigh.c,v 1.101 2006-10-24 08:07:02 adam Exp $ */ /** * \file seshigh.c @@ -906,6 +906,7 @@ static void srw_bend_search(association *assoc, request *req, if (srw_req->query_type == Z_SRW_query_type_cql) { + yaz_log(YLOG_LOG, "CQL string=%s", srw_req->query.cql); if (assoc->server && assoc->server->cql_transform) { int srw_errcode = cql2pqf(assoc->encode, srw_req->query.cql, @@ -2321,7 +2322,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) assoc->init->implementation_name, odr_prepend(assoc->encode, "GFS", resp->implementationName)); - version = odr_strdup(assoc->encode, "$Revision: 1.100 $"); + version = odr_strdup(assoc->encode, "$Revision: 1.101 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; resp->implementationVersion = odr_prepend(assoc->encode, diff --git a/src/srw.c b/src/srw.c index 0618cbd..197a5de 100644 --- a/src/srw.c +++ b/src/srw.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: srw.c,v 1.48 2006-08-18 06:30:05 adam Exp $ + * $Id: srw.c,v 1.49 2006-10-24 08:07:02 adam Exp $ */ /** * \file srw.c @@ -604,6 +604,11 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data, &req->database)) ; } + if (!req->query.cql && !req->query.pqf && !req->query.xcql) + { + /* should put proper diagnostic here */ + return -1; + } } else if (!xmlStrcmp(method->name, BAD_CAST "searchRetrieveResponse")) { -- 1.7.10.4