From f3121db1cc269aa081e0a9b42f851e9da8c9f60e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 29 Jan 2004 20:53:34 +0000 Subject: [PATCH] Update proxy to work with SRW diagnostic code as a URI/string --- ChangeLog | 2 ++ src/yaz-proxy.cpp | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 308af11..9a9146f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ +Update proxy to work with SRW diagnostic code as a URI/string. + Proxy now throws 'unsupported transfer syntax' / 'unsupported ESN' properly. Multiple explain records may exist for one target. Proxy checks contents of diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 97ec2de..2700553 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2004, Index Data. * See the file LICENSE for details. * - * $Id: yaz-proxy.cpp,v 1.91 2004-01-15 23:44:58 adam Exp $ + * $Id: yaz-proxy.cpp,v 1.92 2004-01-29 20:53:34 adam Exp $ */ #include @@ -769,8 +769,7 @@ int Yaz_Proxy::send_to_srw_client_error(int srw_error, const char *add) srw_res->num_diagnostics = 1; srw_res->diagnostics = (Z_SRW_diagnostic *) odr_malloc(o, sizeof(*srw_res->diagnostics)); - srw_res->diagnostics[0].code = odr_intdup(o, srw_error); - srw_res->diagnostics[0].details = add ? odr_strdup(o, add) : 0; + yaz_mk_std_diagnostic(o, srw_res->diagnostics, srw_error, add); return send_srw_response(srw_pdu); } @@ -783,9 +782,9 @@ int Yaz_Proxy::z_to_srw_diag(ODR o, Z_SRW_searchRetrieveResponse *srw_res, srw_res->num_diagnostics = 1; srw_res->diagnostics = (Z_SRW_diagnostic *) odr_malloc(o, sizeof(*srw_res->diagnostics)); - srw_res->diagnostics[0].code = - odr_intdup(o, yaz_diag_bib1_to_srw(*ddf->condition)); - srw_res->diagnostics[0].details = ddf->u.v2Addinfo; + yaz_mk_std_diagnostic(o, srw_res->diagnostics, + yaz_diag_bib1_to_srw(*ddf->condition), + ddf->u.v2Addinfo); return 0; } -- 1.7.10.4