From: Adam Dickmeiss Date: Wed, 15 Jun 2011 09:01:29 +0000 (+0200) Subject: zoom: tweak CCL to Z39.50 diagnostics. X-Git-Tag: v1.2.6~1 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=bb4e0b54f53e46d28b8196be71d5c5d1976fc0ba;p=metaproxy-moved-to-github.git zoom: tweak CCL to Z39.50 diagnostics. --- diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index d38f6ea..82928c3 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -377,11 +377,6 @@ yf::Zoom::SearchablePtr yf::Zoom::Impl::parse_torus(const xmlNode *ptr1) (const char *) ptr3->name + 7); } } - if (s->database.length() && s->target.length()) - { - yaz_log(YLOG_LOG, "add db=%s target=%s", - s->database.c_str(), s->target.c_str()); - } return s; } } @@ -777,7 +772,6 @@ void yf::Zoom::Frontend::handle_search(mp::Package &package) char ccl_buf[1024]; r = cql_to_ccl_buf(cn, ccl_buf, sizeof(ccl_buf)); - yaz_log(YLOG_LOG, "cql_to_ccl_buf returned %d", r); if (r == 0) { ccl_wrbuf = wrbuf_alloc(); @@ -814,11 +808,21 @@ void yf::Zoom::Frontend::handle_search(mp::Package &package) if (!cn) { char *addinfo = odr_strdup(odr, ccl_err_msg(cerror)); + int z3950_diag = YAZ_BIB1_MALFORMED_QUERY; + switch (cerror) + { + case CCL_ERR_UNKNOWN_QUAL: + z3950_diag = YAZ_BIB1_UNSUPP_USE_ATTRIBUTE; + break; + case CCL_ERR_TRUNC_NOT_LEFT: + case CCL_ERR_TRUNC_NOT_RIGHT: + case CCL_ERR_TRUNC_NOT_BOTH: + z3950_diag = YAZ_BIB1_UNSUPP_TRUNCATION_ATTRIBUTE; + break; + } apdu_res = - odr.create_searchResponse(apdu_req, - YAZ_BIB1_MALFORMED_QUERY, - addinfo); + odr.create_searchResponse(apdu_req, z3950_diag, addinfo); package.response() = apdu_res; return; }