X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=client%2Fclient.c;h=2d24363c988fb3f28ecbefc71c1fb9424e0b19a5;hp=5aeb19ef6ccc7ea9489c035ca320827d1511aa51;hb=a54c709b3e2feff5762bfa7dfa8ee653b429d369;hpb=1f7d2e9faf6827f8890750cc1a404d119101c073 diff --git a/client/client.c b/client/client.c index 5aeb19e..2d24363 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.195 2003-05-20 20:33:29 adam Exp $ */ #include @@ -77,7 +77,6 @@ static Z_ElementSetNames *elementSetNames = 0; static int setno = 1; /* current set offset */ static enum oid_proto protocol = PROTO_Z3950; /* current app protocol */ static enum oid_value recordsyntax = VAL_USMARC; -//static enum oid_value schema = VAL_NONE; static char *schema = 0; static int sent_close = 0; static NMEM session_mem = NULL; /* memory handle for init-response */ @@ -183,7 +182,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 +198,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 +208,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 +297,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 +1138,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; }