X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=client%2Fclient.c;h=2b314f5188f9e6372db23be21f40fa7cb0ab2a29;hp=5aeb19ef6ccc7ea9489c035ca320827d1511aa51;hb=ec1f815d5348cd21e393f76bc212c910c34bbc45;hpb=05d1794c4ac57eabe6f6da766156f6986d5c987c diff --git a/client/client.c b/client/client.c index 5aeb19e..2b314f5 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.193 2003-05-19 20:44:33 adam Exp $ + * $Id: client.c,v 1.194 2003-05-20 19:55:29 adam Exp $ */ #include @@ -183,7 +183,7 @@ void add_otherInfos(Z_APDU *a) } } -void send_apdu(Z_APDU *a) +int send_apdu(Z_APDU *a) { char *buf; int len; @@ -199,7 +199,7 @@ void send_apdu(Z_APDU *a) { odr_perror(out, "Encoding APDU"); close_session(); - return; + return 0; } buf = odr_getbuf(out, &len, 0); if (ber_file) @@ -209,10 +209,11 @@ void send_apdu(Z_APDU *a) { fprintf(stderr, "cs_put: %s", cs_errmsg(cs_errno(conn))); close_session(); - return; + return 0; } do_hex_dump(buf,len); odr_reset(out); /* release the APDU structure */ + return 1; } static void print_stringn(const unsigned char *buf, size_t len) @@ -297,8 +298,8 @@ static void send_initRequest(const char* type_and_host) } } - send_apdu(apdu); - printf("Sent initrequest.\n"); + if (send_apdu(apdu)) + printf("Sent initrequest.\n"); } static int process_initResponse(Z_InitResponse *res) @@ -1138,9 +1139,9 @@ static int send_searchRequest(const char *arg) printf ("Unsupported query type\n"); return 0; } - send_apdu(apdu); + if (send_apdu(apdu)) + printf("Sent searchRequest.\n"); setno = 1; - printf("Sent searchRequest.\n"); return 2; }