X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Ffilter_multi.cpp;h=c0a03fb9d72de21ece7d9b16c2e471003bce7fe7;hb=c3ec646811954cecae6abffa4c4bf8d41ff68bb1;hp=0ee83721c7c949bbf0e07b0a37af62f7f626f7b2;hpb=e691d19741323aae3c4c5906859fa2bb5f9755b9;p=metaproxy-moved-to-github.git diff --git a/src/filter_multi.cpp b/src/filter_multi.cpp index 0ee8372..c0a03fb 100644 --- a/src/filter_multi.cpp +++ b/src/filter_multi.cpp @@ -1,5 +1,5 @@ /* This file is part of Metaproxy. - Copyright (C) 2005-2010 Index Data + Copyright (C) 2005-2011 Index Data Metaproxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -417,6 +417,8 @@ void yf::Multi::Frontend::init(mp::Package &package, Z_GDU *gdu) mp::util::set_vhost_otherinfo(&init_apdu->u.initRequest->otherInfo, odr, vhost_one); + init_apdu->u.initRequest->idAuthentication = req->idAuthentication; + Z_InitRequest *req = init_apdu->u.initRequest; ODR_MASK_SET(req->options, Z_Options_search); @@ -443,6 +445,7 @@ void yf::Multi::Frontend::init(mp::Package &package, Z_GDU *gdu) ODR_MASK_SET(f_resp->options, Z_Options_search); ODR_MASK_SET(f_resp->options, Z_Options_present); ODR_MASK_SET(f_resp->options, Z_Options_namedResultSets); + ODR_MASK_SET(f_resp->options, Z_Options_scan); ODR_MASK_SET(f_resp->protocolVersion, Z_ProtocolVersion_1); ODR_MASK_SET(f_resp->protocolVersion, Z_ProtocolVersion_2); @@ -461,8 +464,6 @@ void yf::Multi::Frontend::init(mp::Package &package, Z_GDU *gdu) bit = m_backend_list.erase(bit); continue; } - no_succeeded++; - Z_GDU *gdu = p->response().get(); if (gdu && gdu->which == Z_GDU_Z3950 && gdu->u.z3950->which == Z_APDU_initResponse) @@ -481,28 +482,30 @@ void yf::Multi::Frontend::init(mp::Package &package, Z_GDU *gdu) for (i = 0; i <= Z_ProtocolVersion_3; i++) if (!ODR_MASK_GET(b_resp->protocolVersion, i)) ODR_MASK_CLEAR(f_resp->protocolVersion, i); - // reject if any of the backends reject - if (!*b_resp->result) - *f_resp->result = 0; + if (*b_resp->result) + no_succeeded++; + else + no_failed++; } else - { - // if any target does not return init return that (close or - // similar ) - package.response() = p->response(); - return; - } + no_failed++; bit++; } if (m_p->m_hide_unavailable) { if (no_succeeded == 0) + { + *f_resp->result = 0; package.session().close(); + } } else { if (no_failed) + { + *f_resp->result = 0; package.session().close(); + } } package.response() = f_apdu; }