From 0ef85492914ba31cc19d4ca65682c4d61fd69145 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 3 Sep 2004 18:55:59 +0000 Subject: [PATCH] Manually test for OCLC UI OID and print --- client/client.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/client/client.c b/client/client.c index 6b86e8c..0389070 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. * - * $Id: client.c,v 1.247 2004-08-13 11:36:48 adam Exp $ + * $Id: client.c,v 1.248 2004-09-03 18:55:59 adam Exp $ */ #include @@ -379,9 +379,25 @@ static int process_initResponse(Z_InitResponse *res) printf("Guessing visiblestring:\n"); printf("'%s'\n", uif->u. octet_aligned->buf); } else if (uif->which == Z_External_single) { - /* Peek at any private Init-diagnostic APDUs */ Odr_any *sat = uif->u.single_ASN1_type; - printf("### NAUGHTY: External is '%s'\n", sat->buf); + oident *oid = oid_getentbyoid(uif->direct_reference); + if (oid->value == VAL_OCLCUI) { + Z_OCLC_UserInformation *oclc_ui; + ODR decode = odr_createmem(ODR_DECODE); + odr_setbuf(decode, sat->buf, sat->len, 0); + if (!z_OCLC_UserInformation(decode, &oclc_ui, 0, 0)) + printf ("Bad OCLC UserInformation:\n"); + else + printf ("OCLC UserInformation:\n"); + if (!z_OCLC_UserInformation(print, &oclc_ui, 0, 0)) + printf ("Bad OCLC UserInformation spec\n"); + odr_destroy(decode); + } + else + { + /* Peek at any private Init-diagnostic APDUs */ + printf("### NAUGHTY: External is '%.*s'\n", sat->len, sat->buf); + } } odr_reset (print); } -- 1.7.10.4