* 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 <stdio.h>
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 */
}
}
-void send_apdu(Z_APDU *a)
+int send_apdu(Z_APDU *a)
{
char *buf;
int len;
{
odr_perror(out, "Encoding APDU");
close_session();
- return;
+ return 0;
}
buf = odr_getbuf(out, &len, 0);
if (ber_file)
{
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)
}
}
- send_apdu(apdu);
- printf("Sent initrequest.\n");
+ if (send_apdu(apdu))
+ printf("Sent initrequest.\n");
}
static int process_initResponse(Z_InitResponse *res)
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;
}