-/*
- * Copyright (c) 1998-2007, Index Data.
+/* This file is part of the yazpp toolkit.
+ * Copyright (C) 1998-2012 Index Data and Mike Taylor
* See the file LICENSE for details.
- *
- * $Id: yaz-z-assoc.cpp,v 1.43 2007-05-08 12:04:50 adam Exp $
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <assert.h>
#include <signal.h>
}
else
{
- close();
+ m_PDU_Observable->shutdown();
failNotify();
}
}
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;
void Z_Assoc::close()
{
- m_PDU_Observable->close ();
+ m_PDU_Observable->close_session();
}
int Z_Assoc::server(const char *addr)
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab