{
Z_SearchRequest *req = apdu_req->u.searchRequest;
std::string resultSetId = req->resultSetName;
- Package b_package(package.session(), package.origin());
mp::odr odr;
Odr_oid *syntax = 0;
if (req->preferredRecordSyntax)
syntax = odr_oiddup(odr, req->preferredRecordSyntax);
- b_package.copy_filter(package);
Sets_it sets_it = m_sets.find(req->resultSetName);
if (sets_it != m_sets.end())
{
}
ResultSetPtr s(new ResultSet);
m_sets[resultSetId] = s;
- package.move();
- Z_GDU *gdu_res = package.response().get();
+
+ Package b_package(package.session(), package.origin());
+ b_package.copy_filter(package);
+ b_package.request() = apdu_req;
+ b_package.move();
+
+ Z_GDU *gdu_res = b_package.response().get();
if (gdu_res && gdu_res->which == Z_GDU_Z3950 && gdu_res->u.z3950->which ==
Z_APDU_searchResponse)
{
Z_SearchResponse *res = gdu_res->u.z3950->u.searchResponse;
- Z_RecordComposition *record_comp =
+ Z_RecordComposition *record_comp =
mp::util::piggyback_to_RecordComposition(odr,
*res->resultCount, req);
s->hit_count = *res->resultCount;
syntax, record_comp, resultSetId.c_str());
package.response() = gdu_res;
}
+ else
+ package.response() = b_package.response();
+ if (b_package.session().is_closed())
+ b_package.session().close();
}
void yf::Sort::Frontend::handle_present(mp::Package &package, Z_APDU *apdu_req)
{
Z_PresentRequest *req = apdu_req->u.presentRequest;
std::string resultSetId = req->resultSetId;
- Package b_package(package.session(), package.origin());
mp::odr odr;
Odr_oid *syntax = 0;
Odr_int start = *req->resultSetStartPoint;
if (req->preferredRecordSyntax)
syntax = odr_oiddup(odr, req->preferredRecordSyntax);
- b_package.copy_filter(package);
Sets_it sets_it = m_sets.find(resultSetId);
if (sets_it == m_sets.end())
{
}
break;
}
- package.move();
+
+
+ Package b_package(package.session(), package.origin());
+ b_package.copy_filter(package);
+ b_package.request() = apdu_req;
+ b_package.move();
Z_GDU *gdu_res = package.response().get();
if (gdu_res && gdu_res->which == Z_GDU_Z3950 && gdu_res->u.z3950->which ==
Z_APDU_presentResponse)
resultSetId.c_str());
package.response() = gdu_res;
}
+ else
+ package.response() = b_package.response();
+ if (b_package.session().is_closed())
+ b_package.session().close();
}
void yf::Sort::Frontend::handle_package(mp::Package &package)