X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;ds=sidebyside;f=src%2Fgduutil.cpp;h=47014d66387ced3f363d344caf58e3b6bab32fa2;hb=04b73acd94679a3230324eec3ece7a1e4138d8fe;hp=e0b971fa34ef6cd58e830c243b6adba3a78d35d0;hpb=f9f0ca0d1907f9922889910d1ce7a83bf11ffa63;p=metaproxy-moved-to-github.git diff --git a/src/gduutil.cpp b/src/gduutil.cpp index e0b971f..47014d6 100644 --- a/src/gduutil.cpp +++ b/src/gduutil.cpp @@ -1,4 +1,4 @@ -/* $Id: gduutil.cpp,v 1.18 2007-03-20 07:57:54 adam Exp $ +/* $Id: gduutil.cpp,v 1.20 2007-04-13 09:57:51 adam Exp $ Copyright (c) 2005-2007, Index Data. See the LICENSE file for details @@ -8,6 +8,7 @@ #include "util.hpp" #include +#include #include #include @@ -129,7 +130,8 @@ std::ostream& std::operator<<(std::ostream& os, Z_APDU& zapdu) = zapdu.u.initRequest; Z_IdAuthentication *a = ir->idAuthentication; - if (a && a->which == Z_IdAuthentication_idPass ) + if (a && a->which == Z_IdAuthentication_idPass + && a->u.idPass->userId) os << a->u.idPass->userId << " "; //<< ":" << a->u.idPass->groupId << " "; else @@ -144,10 +146,13 @@ std::ostream& std::operator<<(std::ostream& os, Z_APDU& zapdu) else os << "-" << " " ; - os << (ir->implementationId) << " " - //<< ir->referenceId << " " - << (ir->implementationName) << " " - << (ir->implementationVersion); + if (ir->implementationId) + os << (ir->implementationId) << " "; + //<< ir->referenceId << " " + if (ir->implementationName) + os<< (ir->implementationName) << " "; + if (ir->implementationVersion) + os << (ir->implementationVersion) << " "; } break; case Z_APDU_initResponse: @@ -155,12 +160,16 @@ std::ostream& std::operator<<(std::ostream& os, Z_APDU& zapdu) { Z_InitResponse *ir = zapdu.u.initResponse; - if (ir->result && *(ir->result)) - os << "OK" << " " - << (ir->implementationId) << " " + if (ir->result && *(ir->result)){ + os << "OK" << " "; + if (ir->implementationId) + os << (ir->implementationId) << " "; //<< ir->referenceId << " " - << (ir->implementationName) << " " - << (ir->implementationVersion) << " "; + if (ir->implementationName) + os<< (ir->implementationName) << " "; + if (ir->implementationVersion) + os << (ir->implementationVersion) << " "; + } else os << "DIAG"; } @@ -233,8 +242,13 @@ std::ostream& std::operator<<(std::ostream& os, Z_APDU& zapdu) else os << " -"; if (pr->preferredRecordSyntax) - //os << " " << pr->preferredRecordSyntax; - os << " " <<(oid_getentbyoid(pr->preferredRecordSyntax))->desc; + { + char oid_name_str[OID_STR_MAX]; + const char *oid_name = yaz_oid_to_string_buf( + pr->preferredRecordSyntax, 0, oid_name_str); + + os << " " << oid_name; + } else os << " -"; const char * msg = 0; @@ -335,7 +349,8 @@ std::ostream& std::operator<<(std::ostream& os, Z_APDU& zapdu) if (sr->termListAndStartPoint) { WRBUF wr = wrbuf_alloc(); - yaz_scan_to_wrbuf(wr, sr->termListAndStartPoint, VAL_NONE); + yaz_scan_to_wrbuf(wr, sr->termListAndStartPoint, + sr->attributeSet); os << wrbuf_cstr(wr); wrbuf_destroy(wr); }