+ Z_DiagRec *dr = drecs->diagRecs[i];
+
+ if (dr->which == Z_DiagRec_defaultFormat)
+ fixup_nsd(odr, dr->u.defaultFormat);
+ }
+ }
+}
+
+void yf::Z3950Client::Assoc::fixup_init(ODR odr, Z_InitResponse *initrs)
+{
+ Z_External *uif = initrs->userInformationField;
+
+ if (uif && uif->which == Z_External_userInfo1)
+ {
+ Z_OtherInformation *ui = uif->u.userInfo1;
+ int i;
+ for (i = 0; i < ui->num_elements; i++)
+ {
+ Z_OtherInformationUnit *unit = ui->list[i];
+ if (unit->which == Z_OtherInfo_externallyDefinedInfo &&
+ unit->information.externallyDefinedInfo &&
+ unit->information.externallyDefinedInfo->which ==
+ Z_External_diag1)
+ {
+ Z_DiagnosticFormat *diag =
+ unit->information.externallyDefinedInfo->u.diag1;
+ int j;
+ for (j = 0; j < diag->num; j++)
+ {
+ Z_DiagnosticFormat_s *ds = diag->elements[j];
+ if (ds->which == Z_DiagnosticFormat_s_defaultDiagRec)
+ {
+ Z_DefaultDiagFormat *r = ds->u.defaultDiagRec;
+ char *oaddinfo = r->u.v2Addinfo;
+ char *naddinfo = (char *) odr_malloc(
+ odr,
+ (oaddinfo ? strlen(oaddinfo) : 0) + 20 +
+ m_host.length());
+ if (oaddinfo && *oaddinfo)
+ {
+ strcpy(naddinfo, oaddinfo);
+ strcat(naddinfo, " ");
+ }
+ strcat(naddinfo, "(backend=");
+ strcat(naddinfo, m_host.c_str());
+ strcat(naddinfo, ")");
+
+ r->u.v2Addinfo = naddinfo;
+ }
+ }
+ }