Filter virt_db: relay init sz parameters
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 14 Feb 2011 13:03:26 +0000 (14:03 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 14 Feb 2011 13:03:26 +0000 (14:03 +0100)
Filter virt_db relays {preferredMessage,maximumRecord}Size to backend
filters and also negotiates to whatever the client suggests, because
we don't know that backends are really capable of anyway.

src/filter_virt_db.cpp

index b30e7b4..243f8d7 100644 (file)
@@ -212,6 +212,8 @@ yf::VirtualDB::BackendPtr yf::VirtualDB::Frontend::init_backend(
     req->implementationId = org_init->implementationId;
     req->implementationName = org_init->implementationName;
     req->implementationVersion = org_init->implementationVersion;
+    *req->preferredMessageSize = *org_init->preferredMessageSize;
+    *req->maximumRecordSize = *org_init->maximumRecordSize;
 
     ODR_MASK_SET(req->options, Z_Options_search);
     ODR_MASK_SET(req->options, Z_Options_present);
@@ -736,6 +738,9 @@ void yf::VirtualDB::process(mp::Package &package) const
                 else
                     break;
             
+            *resp->preferredMessageSize = *req->preferredMessageSize;
+            *resp->maximumRecordSize = *req->maximumRecordSize;
+
             package.response() = apdu;
             f->m_is_virtual = true;
         }