X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fyaz-z-assoc.cpp;h=e268248d6060b17a080d65ec61a890c0d176af94;hb=bed85d2160500f57db63f4ab9d5533e0225cce15;hp=e389184c6a327d70dafd9196754d4306e3c6790c;hpb=d1010e2fab0026b538230f67293bd5d4724c0913;p=yazpp-moved-to-github.git diff --git a/src/yaz-z-assoc.cpp b/src/yaz-z-assoc.cpp index e389184..e268248 100644 --- a/src/yaz-z-assoc.cpp +++ b/src/yaz-z-assoc.cpp @@ -1,5 +1,5 @@ /* This file is part of the yazpp toolkit. - * Copyright (C) 1998-2011 Index Data and Mike Taylor + * Copyright (C) 1998-2012 Index Data and Mike Taylor * See the file LICENSE for details. */ @@ -218,7 +218,15 @@ Z_GDU *Z_Assoc::decode_GDU(const char *buf, int len) yaz_log(YLOG_LOG, "PDU decode failed '%s' near byte %ld. Element %s", odr_errmsg(odr_geterror(m_odr_in)), (long) odr_offset(m_odr_in), - element ? element : "unknown"); + element && *element ? element : "unknown"); + yaz_log(YLOG_LOG, "Buffer length: %d", (int) len); + if (len > 0) + { + WRBUF w = wrbuf_alloc(); + wrbuf_write_escaped(w, buf, len > 1024 ? 1024 : len); + yaz_log(YLOG_LOG, "Buffer bytes: %s", wrbuf_cstr(w)); + wrbuf_destroy(w); + } yaz_log(YLOG_LOG, "PDU dump:"); odr_dumpBER(yaz_log_file(), buf, len); return 0;