From: Adam Dickmeiss Date: Mon, 14 Feb 2011 13:05:21 +0000 (+0100) Subject: Filter multi: relay init sz parameters X-Git-Tag: v1.2.5~1^2~11 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=b7c568b24942cf033093da7be2849c9de6a2ae35;p=metaproxy-moved-to-github.git Filter multi: relay init sz parameters Filter virt_db relays {preferredMessage,maximumRecord}Size to backends and returns minimum of each value returned. --- diff --git a/src/filter_multi.cpp b/src/filter_multi.cpp index 1165cbd..263160d 100644 --- a/src/filter_multi.cpp +++ b/src/filter_multi.cpp @@ -422,6 +422,9 @@ void yf::Multi::Frontend::init(mp::Package &package, Z_GDU *gdu) breq->idAuthentication = req->idAuthentication; + *breq->preferredMessageSize = *req->preferredMessageSize; + *breq->maximumRecordSize = *req->maximumRecordSize; + ODR_MASK_SET(breq->options, Z_Options_search); ODR_MASK_SET(breq->options, Z_Options_present); ODR_MASK_SET(breq->options, Z_Options_namedResultSets); @@ -454,6 +457,9 @@ void yf::Multi::Frontend::init(mp::Package &package, Z_GDU *gdu) int no_failed = 0; int no_succeeded = 0; + + Odr_int preferredMessageSize = *req->preferredMessageSize; + Odr_int maximumRecordSize = *req->maximumRecordSize; for (bit = m_backend_list.begin(); bit != m_backend_list.end(); ) { PackagePtr p = (*bit)->m_package; @@ -484,7 +490,13 @@ void yf::Multi::Frontend::init(mp::Package &package, Z_GDU *gdu) if (!ODR_MASK_GET(b_resp->protocolVersion, i)) ODR_MASK_CLEAR(f_resp->protocolVersion, i); if (*b_resp->result) + { no_succeeded++; + if (preferredMessageSize > *b_resp->preferredMessageSize) + preferredMessageSize = *b_resp->preferredMessageSize; + if (maximumRecordSize > *b_resp->maximumRecordSize) + maximumRecordSize = *b_resp->maximumRecordSize; + } else no_failed++; } @@ -492,6 +504,9 @@ void yf::Multi::Frontend::init(mp::Package &package, Z_GDU *gdu) no_failed++; bit++; } + *f_resp->preferredMessageSize = preferredMessageSize; + *f_resp->maximumRecordSize = maximumRecordSize; + if (m_p->m_hide_unavailable) { if (no_succeeded == 0)