X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;h=daee88853df3c5f0c8c0179e2269c2c9c4bc52fb;hb=983b28466be0739a9408c79624aedb47894504a3;hp=0b0e8fe843fcd1367fc48766227ff709e8e9271f;hpb=06eb0818f902a5d6805b656e0ba2e39ac2ed7817;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index 0b0e8fe..daee888 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * 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 @@ -1197,8 +1197,12 @@ static int send_srw(Z_SRW_PDU *sr) 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 */ @@ -2140,7 +2144,7 @@ static int cmd_explain(const char *arg) #if HAVE_XML2 if (!conn) cmd_open(0); - if (1) + if (conn) { Z_SRW_PDU *sr = 0; @@ -2151,9 +2155,8 @@ static int cmd_explain(const char *arg) send_srw(sr); return 2; } -#else - return 0; #endif + return 0; } static int cmd_find(const char *arg) @@ -2168,6 +2171,8 @@ 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 @@ -2434,6 +2439,8 @@ static int cmd_show(const char *arg) #if HAVE_XML2 if (!conn) cmd_open(0); + if (!conn) + return 0; if (!send_SRW_presentRequest(arg)) return 0; #else @@ -3443,7 +3450,10 @@ void wait_and_handle_response() 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;