X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;h=5cce8ccc026901b8d0eaaf37a5db8166ab24c7aa;hb=bc4b50939a936dbb214c783c18a44039ea048fdd;hp=468a0ea9f1743719d8ef69d68b92b510c3ce7d8a;hpb=b568ddecc89242451a7f2188d027b3d2b8d2c4ba;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index 468a0ea..5cce8cc 100644 --- a/client/client.c +++ b/client/client.c @@ -1,8 +1,6 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2008 Index Data * See the file LICENSE for details. - * - * $Id: client.c,v 1.356 2007-12-27 13:27:40 adam Exp $ */ /** \file client.c * \brief yaz-client program @@ -35,15 +33,6 @@ #include #endif -#if HAVE_OPENSSL_SSL_H -#include -#include -#include -#include -#include -#include -#endif - #ifdef WIN32 #include #include @@ -362,21 +351,6 @@ static void send_initRequest(const char* type_and_host) negotiationCharsetRecords); } } - else if (ODR_MASK_GET(req->options, Z_Options_negotiationModel)) - { - Z_OtherInformation **p; - Z_OtherInformationUnit *p0; - - yaz_oi_APDU(apdu, &p); - - if ((p0=yaz_oi_update(p, out, NULL, 0, 0))) - { - p0->which = Z_OtherInfo_externallyDefinedInfo; - p0->information.externallyDefinedInfo = - yaz_set_proposal_charneg(out, 0, 0, 0, 0, 0); - } - - } if (send_apdu(apdu)) printf("Sent initrequest.\n"); } @@ -693,9 +667,6 @@ int session_connect(const char *arg) void *add; char type_and_host[101]; const char *basep = 0; -#if HAVE_OPENSSL_SSL_H - SSL *ssl; -#endif if (conn) { cs_close(conn); @@ -748,30 +719,7 @@ int session_connect(const char *arg) return 0; } printf("OK.\n"); -#if HAVE_OPENSSL_SSL_H - if ((ssl = (SSL *) cs_get_ssl(conn))) - { - X509 *server_cert = SSL_get_peer_certificate (ssl); - - if (server_cert) - { - char *pem_buf; - int pem_len; - BIO *bio = BIO_new(BIO_s_mem()); - - /* get PEM buffer in memory */ - PEM_write_bio_X509(bio, server_cert); - pem_len = BIO_get_mem_data(bio, &pem_buf); - fwrite(pem_buf, pem_len, 1, stdout); - - /* print all info on screen .. */ - X509_print_fp(stdout, server_cert); - BIO_free(bio); - - X509_free (server_cert); - } - } -#endif + cs_print_session_info(conn); if (basep && *basep) set_base (basep); if (protocol == PROTO_Z3950) @@ -2188,8 +2136,10 @@ static int cmd_update0(const char *arg) static int cmd_update_Z3950(int version, int action_no, const char *recid, char *rec_buf, int rec_len); +#if YAZ_HAVE_XML2 static int cmd_update_SRW(int action_no, const char *recid, char *rec_buf, int rec_len); +#endif static int cmd_update_common(const char *arg, int version) { @@ -3319,12 +3269,24 @@ int cmd_format(const char *arg) printf("Usage: format \n"); return 0; } + while (sscanf(cp, "%40s%n", form_str, &nor) >= 1 && nor > 0 + && idx < RECORDSYNTAX_MAX) + { + if (strcmp(form_str, "none") && + !yaz_string_to_oid_odr(yaz_oid_std(), CLASS_RECSYN, form_str, out)) + { + printf("Bad format: %s\n", form_str); + return 0; + } + cp += nor; + } for (i = 0; i < recordsyntax_size; i++) { xfree(recordsyntax_list[i]); recordsyntax_list[i] = 0; } - + + cp = arg; while (sscanf(cp, "%40s%n", form_str, &nor) >= 1 && nor > 0 && idx < RECORDSYNTAX_MAX) { @@ -4934,7 +4896,6 @@ int main(int argc, char **argv) ODR_MASK_SET(&z3950_options, Z_Options_sort); ODR_MASK_SET(&z3950_options, Z_Options_extendedServices); ODR_MASK_SET(&z3950_options, Z_Options_delSet); - ODR_MASK_SET(&z3950_options, Z_Options_negotiationModel); while ((ret = options("k:c:q:a:b:m:v:p:u:t:Vxd:f:", argv, argc, &arg)) != -2) {