From: Adam Dickmeiss Date: Wed, 18 Jan 2012 14:31:30 +0000 (+0100) Subject: Fix diagnostic fix up X-Git-Tag: v1.3.22~12 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=f7a44b23d29c36ada743bbdb2898b3a81e7deaf9;p=metaproxy-moved-to-github.git Fix diagnostic fix up The diagnostic fix up where (backend host) is added would not be added for v3addinfo. --- diff --git a/src/filter_z3950_client.cpp b/src/filter_z3950_client.cpp index 53d0762..fe3049e 100644 --- a/src/filter_z3950_client.cpp +++ b/src/filter_z3950_client.cpp @@ -174,18 +174,20 @@ void yf::Z3950Client::Assoc::fixup_nsd(ODR odr, Z_Records *records) if (records && records->which == Z_Records_NSD) { Z_DefaultDiagFormat *nsd = records->u.nonSurrogateDiagnostic; - if (nsd->which == Z_DiagRec_defaultFormat) - { - std::string addinfo; + std::string addinfo; + + // should really check for nsd->which.. But union has two members + // containing almost same data + // char *v2Addinfo; + // Z_InternationalString *v3Addinfo; - if (nsd->u.v2Addinfo) - { - addinfo.assign(nsd->u.v2Addinfo); - addinfo += " "; - } - addinfo += "(backend=" + m_host + ")"; - nsd->u.v2Addinfo = odr_strdup(odr, addinfo.c_str()); + if (nsd->u.v2Addinfo) + { + addinfo.assign(nsd->u.v2Addinfo); + addinfo += " "; } + addinfo += "(backend=" + m_host + ")"; + nsd->u.v2Addinfo = odr_strdup(odr, addinfo.c_str()); } }