From: Adam Dickmeiss Date: Fri, 22 Feb 2013 10:41:30 +0000 (+0100) Subject: multi: do not mess with request package X-Git-Tag: v1.3.54~14 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=47b8c6b8d645c3cedbcb4a82f1f0767f8668e0d8;p=metaproxy-moved-to-github.git multi: do not mess with request package For search, database-names were modified and the request package was left with dangling pointers that caused a log filter to fail (request package inspected after multi was invoked). --- diff --git a/etc/config3.xml b/etc/config3.xml index 502aaa8..0a3e860 100644 --- a/etc/config3.xml +++ b/etc/config3.xml @@ -11,7 +11,7 @@ F - + true diff --git a/src/filter_multi.cpp b/src/filter_multi.cpp index baadef4..a453597 100644 --- a/src/filter_multi.cpp +++ b/src/filter_multi.cpp @@ -617,16 +617,6 @@ void yf::Multi::Frontend::search(mp::Package &package, Z_APDU *apdu_req) // create search request Z_SearchRequest *req = apdu_req->u.searchRequest; - // save these for later - Odr_int smallSetUpperBound = *req->smallSetUpperBound; - Odr_int largeSetLowerBound = *req->largeSetLowerBound; - Odr_int mediumSetPresentNumber = *req->mediumSetPresentNumber; - - // they are altered now - to disable piggyback - *req->smallSetUpperBound = 0; - *req->largeSetLowerBound = 1; - *req->mediumSetPresentNumber = 0; - int default_num_db = req->num_databaseNames; char **default_db = req->databaseNames; @@ -634,16 +624,23 @@ void yf::Multi::Frontend::search(mp::Package &package, Z_APDU *apdu_req) for (bit = m_backend_list.begin(); bit != m_backend_list.end(); bit++) { PackagePtr p = (*bit)->m_package; + yazpp_1::GDU gdu1(apdu_req); mp::odr odr; + Z_SearchRequest *req1 = gdu1.get()->u.z3950->u.searchRequest; + + // they are altered now - to disable piggyback + *req1->smallSetUpperBound = 0; + *req1->largeSetLowerBound = 1; + *req1->mediumSetPresentNumber = 0; if (!mp::util::set_databases_from_zurl(odr, (*bit)->m_vhost, - &req->num_databaseNames, - &req->databaseNames)) + &req1->num_databaseNames, + &req1->databaseNames)) { - req->num_databaseNames = default_num_db; - req->databaseNames = default_db; + req1->num_databaseNames = default_num_db; + req1->databaseNames = default_db; } - p->request() = apdu_req; + p->request() = gdu1; p->copy_filter(package); } multi_move(m_backend_list); @@ -716,9 +713,9 @@ void yf::Multi::Frontend::search(mp::Package &package, Z_APDU *apdu_req) m_sets[resultSet.m_setname] = resultSet; Odr_int number; - mp::util::piggyback(smallSetUpperBound, - largeSetLowerBound, - mediumSetPresentNumber, + mp::util::piggyback(*req->smallSetUpperBound, + *req->largeSetLowerBound, + *req->mediumSetPresentNumber, 0, 0, result_set_size, number, 0);