From 7a0b87f3e2efc4263c62d723f4dfd459d324b5c6 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 21 Apr 2010 14:00:45 +0200 Subject: [PATCH] Extend presentResponse logging with proper status --- src/gduutil.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/gduutil.cpp b/src/gduutil.cpp index 50e5bd0..9358976 100644 --- a/src/gduutil.cpp +++ b/src/gduutil.cpp @@ -281,9 +281,24 @@ std::ostream& std::operator<<(std::ostream& os, Z_APDU& zapdu) { Z_PresentResponse *pr = zapdu.u.presentResponse; - if ((pr->presentStatus) && !*(pr->presentStatus)) + if (pr->presentStatus && + *pr->presentStatus != Z_PresentStatus_failure) { - os << "OK"; + switch (*pr->presentStatus) + { + case Z_PresentStatus_success: + os << "OK"; break; + case Z_PresentStatus_partial_1: + os << "Partial-1"; break; + case Z_PresentStatus_partial_2: + os << "Partial-2"; break; + case Z_PresentStatus_partial_3: + os << "Partial-3"; break; + case Z_PresentStatus_partial_4: + os << "Partial-4"; break; + default: + os << "Unknown"; break; + } //<< pr->referenceId << " " if (pr->numberOfRecordsReturned) os << " " << *(pr->numberOfRecordsReturned); -- 1.7.10.4