From: Adam Dickmeiss Date: Fri, 20 Sep 2013 09:14:39 +0000 (+0200) Subject: session_shared: relay facets for response X-Git-Tag: v1.4.0~10 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=b16a88ecd56e0bf89926dfd1eef008bf155221d3;p=metaproxy-moved-to-github.git session_shared: relay facets for response That is: everything in additionalSearchInfo. --- diff --git a/src/filter_session_shared.cpp b/src/filter_session_shared.cpp index 01d35b7..29c4164 100644 --- a/src/filter_session_shared.cpp +++ b/src/filter_session_shared.cpp @@ -80,10 +80,13 @@ namespace metaproxy_1 { time_t m_time_last_use; void timestamp(); yazpp_1::RecordCache m_record_cache; + Z_OtherInformation *additionalSearchInfoResponse; + NMEM mem_additionalSearchInfoResponse; BackendSet( const std::string &result_set_id, const Databases &databases, const yazpp_1::Yaz_Z_Query &query); + ~BackendSet(); bool search( Package &frontend_package, Package &search_package, @@ -579,6 +582,13 @@ yf::SessionShared::BackendSet::BackendSet( m_databases(databases), m_result_set_size(0), m_query(query) { timestamp(); + mem_additionalSearchInfoResponse = nmem_create(); + additionalSearchInfoResponse = 0; +} + +yf::SessionShared::BackendSet::~BackendSet() +{ + nmem_destroy(mem_additionalSearchInfoResponse); } static int get_diagnostic(Z_DefaultDiagFormat *r) @@ -626,7 +636,10 @@ bool yf::SessionShared::BackendSet::search( Z_SearchResponse *b_resp = gdu->u.z3950->u.searchResponse; *z_records = b_resp->records; m_result_set_size = *b_resp->resultCount; - // b_resp->additionalSearchInfo; + + nmem_reset(mem_additionalSearchInfoResponse); + additionalSearchInfoResponse = yaz_clone_z_OtherInformation( + b_resp->additionalSearchInfo, mem_additionalSearchInfoResponse); return true; } Z_APDU *f_apdu = 0; @@ -992,6 +1005,7 @@ void yf::SessionShared::Frontend::search(mp::Package &package, Z_APDU *f_apdu = odr.create_searchResponse(apdu_req, 0, 0); Z_SearchResponse *f_resp = f_apdu->u.searchResponse; *f_resp->resultCount = found_set->m_result_set_size; + f_resp->additionalSearchInfo = found_set->additionalSearchInfoResponse; package.response() = f_apdu; FrontendSetPtr fset(new FrontendSet(databases, query));