* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.216 2003-12-20 00:51:19 adam Exp $
+ * $Id: client.c,v 1.219 2003-12-31 00:14:00 adam Exp $
*/
#include <stdio.h>
char *buf_out;
int len_out;
int r;
- if (apdu_file && !z_GDU(print, &gdu, 0, 0))
- printf ("Failed to print outgoing APDU\n");
+ if (apdu_file)
+ {
+ if (!z_GDU(print, &gdu, 0, 0))
+ printf ("Failed to print outgoing APDU\n");
+ odr_reset(print);
+ }
buf_out = odr_getbuf(out, &len_out, 0);
/* we don't odr_reset(out), since we may need the buffer again */
#if HAVE_XML2
if (!conn)
cmd_open(0);
- if (1)
+ if (conn)
{
Z_SRW_PDU *sr = 0;
send_srw(sr);
return 2;
}
-#else
- return 0;
#endif
+ return 0;
}
static int cmd_find(const char *arg)
#if HAVE_XML2
if (!conn)
cmd_open(0);
+ if (!conn)
+ return 0;
if (!send_SRW_searchRequest(arg))
return 0;
#else
#if HAVE_XML2
if (!conn)
cmd_open(0);
+ if (!conn)
+ return 0;
if (!send_SRW_presentRequest(arg))
return 0;
#else
odr_dumpBER(f, netbuffer, res);
fprintf(f, "---------\n");
if (apdu_file)
+ {
z_GDU(print, &gdu, 0, 0);
+ odr_reset(print);
+ }
if (conn && cs_more(conn))
continue;
break;