void search(Package &package, Z_APDU *apdu);
void present(Package &package, Z_APDU *apdu);
void scan(Package &package, Z_APDU *apdu);
+ int relay_apdu(Package &package, Z_APDU *apdu);
void close(Package &package);
typedef std::map<std::string,VirtualDB::Set>::iterator Sets_it;
delete id;
}
+int yf::VirtualDB::Frontend::relay_apdu(mp::Package &package, Z_APDU *apdu_req)
+{
+ int no = 0;
+ std::list<BackendPtr>::const_iterator map_it;
+ map_it = m_backend_list.begin();
+ for (; map_it != m_backend_list.end(); map_it++)
+ {
+ BackendPtr b = *map_it;
+
+ Package relay_package(b->m_backend_session, package.origin());
+ relay_package.copy_filter(package);
+
+ relay_package.request() = yazpp_1::GDU(apdu_req);
+
+ relay_package.move(b->m_route);
+ package.response() = relay_package.response();
+ no++;
+ }
+ return no;
+}
+
void yf::VirtualDB::Frontend::scan(mp::Package &package, Z_APDU *apdu_req)
{
Z_ScanRequest *req = apdu_req->u.scanRequest;
}
else if (apdu->which == Z_APDU_close)
{
- package.session().close();
+ if (f->relay_apdu(package, apdu) == 0)
+ {
+ mp::odr odr;
+
+ package.response() = odr.create_close(
+ apdu, Z_Close_finished, "virt_db");
+
+ package.session().close();
+ }
}
else
{