* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.203 2003-07-18 19:54:30 mike Exp $
+ * $Id: client.c,v 1.206 2003-07-30 22:33:12 adam Exp $
*/
#include <stdio.h>
{
printf("Guessing visiblestring:\n");
printf("'%s'\n", uif->u. octet_aligned->buf);
- } else if (uif->which == Z_External_single
-// && oid_is(uif->direct_reference, "1.2.840.10003.10.1000.17.1")
- ) {
- /* FirstSearch's crappy private init-diagnostic OID */
+ } 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);
}
yaz_get_response_charneg(session_mem, p, &charset, &lang,
&selected);
+
+ if (outputCharset && negotiationCharset) {
+ odr_set_charset (out, charset, outputCharset);
+ odr_set_charset (in, outputCharset, charset);
+ }
+ else {
+ odr_set_charset (out, 0, 0);
+ odr_set_charset (in, 0, 0);
+ }
printf("Accepted character set : %s\n", charset);
printf("Accepted code language : %s\n", lang ? lang : "none");
if (r == 1)
{
auth = &au;
- au.which = Z_IdAuthentication_open;
- au.u.open = user;
- printf("Authentication set to Open (%s)\n", user);
+ if (!strcmp(user, "-")) {
+ au.which = Z_IdAuthentication_anonymous;
+ printf("Authentication set to Anonymous\n");
+ } else {
+ au.which = Z_IdAuthentication_open;
+ au.u.open = user;
+ printf("Authentication set to Open (%s)\n", user);
+ }
}
if (r == 2)
{
else
printf ("Output charset conversion disabled\n");
}
- if (outputCharset && negotiationCharset)
- {
- odr_set_charset (out, negotiationCharset, outputCharset);
- odr_set_charset (in, outputCharset, negotiationCharset);
- }
- else
- {
- odr_set_charset (out, 0, 0);
- odr_set_charset (in, 0, 0);
- }
+
return 1;
}