logged for some target(s).
Fixed bug #1252: Using record&offset=.. may hang for a long time.
The problem was that a target did return a record initially but
it failed for later present requests . So it was disconnected at the
time the record&offset= was used.
<!ENTITY % idcommon SYSTEM "common/common.ent">
%idcommon;
]>
-<!-- $Id: pazpar2_conf.xml,v 1.27 2007-06-22 13:18:23 adam Exp $ -->
+<!-- $Id: pazpar2_conf.xml,v 1.28 2007-07-03 11:21:48 adam Exp $ -->
<refentry id="pazpar2_conf">
<refentryinfo>
<productname>Pazpar2</productname>
<settings target="*">
<!-- This file introduces default settings for pazpar2 -->
- <!-- $Id: pazpar2_conf.xml,v 1.27 2007-06-22 13:18:23 adam Exp $ -->
+ <!-- $Id: pazpar2_conf.xml,v 1.28 2007-07-03 11:21:48 adam Exp $ -->
<!-- mapping for unqualified search -->
<set name="pz:cclmap:term" value="u=1016 t=l,r s=al"/>
</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term>pz:apdulog</term>
+ <listitem>
+ <para>
+ If the 'pz:apdulog' setting is defined and has other value than 0,
+ then Z39.50 APDUs are written to the log.
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect2>
-/* $Id: client.c,v 1.12 2007-06-19 12:25:29 adam Exp $
+/* $Id: client.c,v 1.13 2007-07-03 11:21:48 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
static int send_apdu(struct client *c, Z_APDU *a)
{
+ struct session_database *sdb = client_get_database(c);
+ const char *apdulog = session_setting_oneval(sdb, PZ_APDULOG);
+ if (apdulog && *apdulog && *apdulog != '0')
+ {
+ ODR p = odr_createmem(ODR_PRINT);
+ yaz_log(YLOG_LOG, "send APDU %s", client_get_url(c));
+
+ odr_setprint(p, yaz_log_file());
+ z_APDU(p, &a, 0, 0);
+ odr_setprint(p, stderr);
+ odr_destroy(p);
+ }
return connection_send_apdu(client_get_connection(c), a);
}
cl->show_raw->esn = xstrdup(esn);
else
cl->show_raw->esn = 0;
- client_continue(cl);
+
+
+ if (cl->state == Client_Failed || cl->state == Client_Disconnected)
+ {
+ client_show_raw_error(cl, "not connected");
+ }
+ else
+ {
+ client_continue(cl);
+ }
return 0;
}
assert(cl->show_raw);
- yaz_log(YLOG_DEBUG, "Trying to present %d record(s) from %d",
- toget, start);
+ yaz_log(YLOG_DEBUG, "%s: trying to present %d record(s) from %d",
+ client_get_url(cl), toget, start);
a->u.presentRequest->resultSetStartPoint = &start;
a->u.presentRequest->numberOfRecordsRequested = &toget;
if (cl->state == Client_Connected) {
client_init_request(cl);
}
-
if (cl->state == Client_Idle)
{
struct session *se = client_get_session(cl);
-/* $Id: connection.c,v 1.5 2007-06-26 13:03:46 adam Exp $
+/* $Id: connection.c,v 1.6 2007-07-03 11:21:48 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
if (client_is_our_response(cl))
{
Z_APDU *a;
+ struct session_database *sdb = client_get_database(cl);
+ const char *apdulog = session_setting_oneval(sdb, PZ_APDULOG);
odr_reset(global_parameters.odr_in);
odr_setbuf(global_parameters.odr_in, co->ibuf, len, 0);
client_fatal(cl);
return;
}
+
+ if (apdulog && *apdulog && *apdulog != '0')
+ {
+ ODR p = odr_createmem(ODR_PRINT);
+ yaz_log(YLOG_LOG, "recv APDU %s", client_get_url(cl));
+
+ odr_setprint(p, yaz_log_file());
+ z_APDU(p, &a, 0, 0);
+ odr_setprint(p, stderr);
+ odr_destroy(p);
+ }
switch (a->which)
{
case Z_APDU_initResponse:
-/* $Id: http_command.c,v 1.55 2007-06-28 09:36:10 adam Exp $
+/* $Id: http_command.c,v 1.56 2007-07-03 11:21:48 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
*/
/*
- * $Id: http_command.c,v 1.55 2007-06-28 09:36:10 adam Exp $
+ * $Id: http_command.c,v 1.56 2007-07-03 11:21:48 adam Exp $
*/
#include <stdio.h>
http_remove_observer(obs);
- error(rs, PAZPAR2_NOT_IMPLEMENTED, addinfo);
+ error(rs, PAZPAR2_RECORD_FAIL, addinfo);
}
static void show_raw_record_ok(void *data, const char *buf, size_t sz)
-/* $Id: settings.c,v 1.24 2007-06-28 09:36:10 adam Exp $
+/* $Id: settings.c,v 1.25 2007-07-03 11:21:48 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
"pz:queryencoding",
"pz:ip",
"pz:zproxy",
+ "pz:apdulog",
0
};
-/* $Id: settings.h,v 1.18 2007-06-06 11:49:48 marc Exp $
+/* $Id: settings.h,v 1.19 2007-07-03 11:21:48 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
#define PZ_QUERYENCODING 11
#define PZ_IP 12
#define PZ_ZPROXY 13
+#define PZ_APDULOG 14
struct setting