From 0cae96a10e8393acabad6b07c9456d9f6175d0ff Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 12 May 2003 22:35:06 +0000 Subject: [PATCH] Fix handling of HTTP error. Dont print details when omitted --- client/client.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/client.c b/client/client.c index 6157a37..d48b74d 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.191 2003-04-30 14:04:45 adam Exp $ + * $Id: client.c,v 1.192 2003-05-12 22:35:06 adam Exp $ */ #include @@ -2041,7 +2041,8 @@ static int send_SRW_presentRequest(const char *arg) static void close_session (void) { - cs_close (conn); + if (conn) + cs_close (conn); conn = 0; if (session_mem) { @@ -2896,10 +2897,12 @@ static void handle_srw_response(Z_SRW_searchRetrieveResponse *res) for (i = 0; inum_diagnostics; i++) { - printf ("SRW diagnostic %d %s\nDetails: %s\n", + printf ("SRW diagnostic %d %s\n", *res->diagnostics[i].code, - yaz_diag_srw_str(*res->diagnostics[i].code), - res->diagnostics[i].details); + yaz_diag_srw_str(*res->diagnostics[i].code)); + + if (res->diagnostics[i].details) + printf ("Details: %s\n", res->diagnostics[i].details); } if (res->numberOfRecords) printf ("Number of hits: %d\n", *res->numberOfRecords); -- 1.7.10.4