- Z_InitRequest *req = init_apdu->u.initRequest;
-
- ODR_MASK_SET(req->options, Z_Options_search);
- ODR_MASK_SET(req->options, Z_Options_present);
- ODR_MASK_SET(req->options, Z_Options_namedResultSets);
- ODR_MASK_SET(req->options, Z_Options_scan);
-
- ODR_MASK_SET(req->protocolVersion, Z_ProtocolVersion_1);
- ODR_MASK_SET(req->protocolVersion, Z_ProtocolVersion_2);
- ODR_MASK_SET(req->protocolVersion, Z_ProtocolVersion_3);
-
+
+ Z_InitRequest *breq = init_apdu->u.initRequest;
+
+ if (b->m_auth.length())
+ {
+ breq->idAuthentication =
+ (Z_IdAuthentication *)
+ odr_malloc(odr, sizeof(*breq->idAuthentication));
+ breq->idAuthentication->which = Z_IdAuthentication_open;
+ breq->idAuthentication->u.open = odr_strdup(odr, b->m_auth.c_str());
+ }
+ else
+ 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);
+ ODR_MASK_SET(breq->options, Z_Options_scan);
+
+ ODR_MASK_SET(breq->protocolVersion, Z_ProtocolVersion_1);
+ ODR_MASK_SET(breq->protocolVersion, Z_ProtocolVersion_2);
+ ODR_MASK_SET(breq->protocolVersion, Z_ProtocolVersion_3);
+