X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Ffilter_zoom.cpp;h=d7ca9356ca780b192773419223390be1f180c635;hb=581e7621e9664408aac1f0386f7d823f4906860c;hp=264fa5a8401a98efbb8a8194b60e9f077b0ed8c2;hpb=57a48e6fff520cb9848e14af3b09f3092cc6436a;p=metaproxy-moved-to-github.git diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index 264fa5a..d7ca935 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -2481,11 +2481,13 @@ void yf::Zoom::Frontend::auth(mp::Package &package, Z_InitRequest *req, yaz_log(YLOG_LOG, "IP=%s", ip.c_str()); std::string torus_query; + int failure_code; if (user.length() && password.length()) { torus_query = "userName==\"" + escape_cql_term(user) + "\" and password==\"" + escape_cql_term(password) + "\""; + failure_code = YAZ_BIB1_INIT_AC_BAD_USERID_AND_OR_PASSWORD; } else { @@ -2497,6 +2499,7 @@ void yf::Zoom::Frontend::auth(mp::Package &package, Z_InitRequest *req, torus_query = "ip encloses/net.ipaddress \""; torus_query += escape_cql_term(std::string(ip_cstr)); torus_query += "\""; + failure_code = YAZ_BIB1_INIT_AC_BLOCKED_NETWORK_ADDRESS; } std::string dummy_db; @@ -2505,7 +2508,8 @@ void yf::Zoom::Frontend::auth(mp::Package &package, Z_InitRequest *req, torus_query, dummy_realm, m_p->proxy); if (!doc) { - *error = YAZ_BIB1_UNSPECIFIED_ERROR; + // something fundamental broken in lookup. + *error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR; *addinfo = odr_strdup(odr, "Torus server unavailable or " "incorrectly configured"); return; @@ -2541,7 +2545,7 @@ void yf::Zoom::Frontend::auth(mp::Package &package, Z_InitRequest *req, } if (!ptr) { - *error = YAZ_BIB1_INIT_AC_BAD_USERID_AND_OR_PASSWORD; + *error = failure_code; return; } session_realm = mp::xml::get_text(ptr);