X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fsru_util.cpp;h=8c9cfb43c8998137f4dbca171d788b08ac49a133;hb=f7e9a24fefaa0fc07d82d4462eeb38af0f25460e;hp=fce602efdf5e1e687e72db71e87b36a2a409eb49;hpb=2d12b3e6e375f6dbf352c2c1e43007fc746f625a;p=metaproxy-moved-to-github.git diff --git a/src/sru_util.cpp b/src/sru_util.cpp index fce602e..8c9cfb4 100644 --- a/src/sru_util.cpp +++ b/src/sru_util.cpp @@ -1,5 +1,5 @@ /* This file is part of Metaproxy. - Copyright (C) 2005-2010 Index Data + Copyright (C) 2005-2012 Index Data Metaproxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -49,8 +49,8 @@ mp_util::SRUServerInfo mp_util::get_sru_server_info(mp::Package &package) mp_util::SRUServerInfo sruinfo; // getting host and port info - sruinfo.host = package.origin().listen_host(); - sruinfo.port = mp_util::to_string(package.origin().listen_port()); + sruinfo.host = "localhost"; + sruinfo.port = "80"; // overwriting host and port info if set from HTTP Host header Z_GDU *zgdu_req = package.request().get(); @@ -286,11 +286,13 @@ mp_util::check_sru_query_exists(mp::Package &package, yaz_add_srw_diagnostic(odr_en, &(sru_pdu_res->u.response->diagnostics), &(sru_pdu_res->u.response->num_diagnostics), - 7, "query"); + YAZ_SRW_MANDATORY_PARAMETER_NOT_SUPPLIED, + "query"); yaz_add_srw_diagnostic(odr_en, &(sru_pdu_res->u.response->diagnostics), &(sru_pdu_res->u.response->num_diagnostics), - 10, "CQL query is empty"); + YAZ_SRW_QUERY_SYNTAX_ERROR, + "CQL query is empty"); return false; } if ((sr_req->query_type == Z_SRW_query_type_xcql && !sr_req->query.xcql)) @@ -298,7 +300,8 @@ mp_util::check_sru_query_exists(mp::Package &package, yaz_add_srw_diagnostic(odr_en, &(sru_pdu_res->u.response->diagnostics), &(sru_pdu_res->u.response->num_diagnostics), - 10, "XCQL query is empty"); + YAZ_SRW_QUERY_SYNTAX_ERROR, + "XCQL query is empty"); return false; } if ((sr_req->query_type == Z_SRW_query_type_pqf && !sr_req->query.pqf)) @@ -306,7 +309,8 @@ mp_util::check_sru_query_exists(mp::Package &package, yaz_add_srw_diagnostic(odr_en, &(sru_pdu_res->u.response->diagnostics), &(sru_pdu_res->u.response->num_diagnostics), - 10, "PQF query is empty"); + YAZ_SRW_QUERY_SYNTAX_ERROR, + "PQF query is empty"); return false; } return true;