projects
/
yazpp-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8fd53b0
)
PDU decode failure: log lead bytes and PDU size
author
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 19 Jan 2012 13:43:26 +0000
(14:43 +0100)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Thu, 19 Jan 2012 13:43:26 +0000
(14:43 +0100)
src/yaz-z-assoc.cpp
patch
|
blob
|
history
diff --git
a/src/yaz-z-assoc.cpp
b/src/yaz-z-assoc.cpp
index
24b60d0
..
6048465
100644
(file)
--- a/
src/yaz-z-assoc.cpp
+++ b/
src/yaz-z-assoc.cpp
@@
-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),
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 > 20 ? 20 : len);
+ yaz_log(YLOG_LOG, "Buffer content: %s", wrbuf_cstr(w));
+ wrbuf_destroy(w);
+ }
yaz_log(YLOG_LOG, "PDU dump:");
odr_dumpBER(yaz_log_file(), buf, len);
return 0;
yaz_log(YLOG_LOG, "PDU dump:");
odr_dumpBER(yaz_log_file(), buf, len);
return 0;