std::string sortStrategy;
std::string extraArgs;
std::string rpn2cql_fname;
+ std::string retry_on_failure;
bool use_turbomarc;
bool piggyback;
CCL_bibset ccl_bibset;
xmlDoc *explain_doc;
std::string m_proxy;
cql_transform_t cqlt;
+ std::string retry_on_failure;
public:
Backend();
~Backend();
std::string torus_content_url;
std::string torus_auth_url;
std::string default_realm;
+ std::string torus_auth_hostname;
std::map<std::string,std::string> fieldmap;
std::string xsldir;
std::string file_path;
piggyback = true;
use_turbomarc = true;
sortStrategy = "embed";
+ retry_on_failure = "1"; // existing default (should have been false)
ccl_bibset = ccl_qual_dup(base);
}
}
else if (!strcmp((const char *) ptr->name, "rpn2cql"))
s->rpn2cql_fname = mp::xml::get_text(ptr);
+ else if (!strcmp((const char *) ptr->name,
+ "retryOnFailure"))
+ {
+ s->retry_on_failure = mp::xml::get_text(ptr);
+ }
}
return s;
}
torus_auth_url = mp::xml::get_text(attr->children);
else if (!strcmp((const char *) attr->name, "realm"))
default_realm = mp::xml::get_text(attr->children);
+ else if (!strcmp((const char *) attr->name, "auth_hostname"))
+ torus_auth_hostname = mp::xml::get_text(attr->children);
else if (!strcmp((const char *) attr->name, "xsldir"))
xsldir = mp::xml::get_text(attr->children);
else if (!strcmp((const char *) attr->name, "element_transform"))
const char *param_content_user = 0;
const char *param_content_password = 0;
const char *param_nocproxy = 0;
+ const char *param_retry = 0;
int no_parms = 0;
char **names;
content_proxy = value;
else if (!strcmp(name, "nocproxy"))
param_nocproxy = value;
+ else if (!strcmp(name, "retry"))
+ param_retry = value;
else if (!strcmp(name, "proxy"))
{
char **dstr;
b->m_frontend_database = database;
b->enable_cproxy = param_nocproxy ? false : true;
+ if (param_retry)
+ b->retry_on_failure = param_retry;
+ else
+ b->retry_on_failure = b->sptr->retry_on_failure;
+
if (sptr->query_encoding.length())
b->set_option("rpnCharset", sptr->query_encoding);
error = YAZ_BIB1_PROXY_FAILURE;
*addinfo = odr_strdup(odr, b->m_proxy.c_str());
}
- else if (same_retries == 0 && proxy_retries == 0)
+ else if (b && b->retry_on_failure.compare("0")
+ && same_retries == 0 && proxy_retries == 0)
{
log_diagnostic(package, error, *addinfo);
same_retries++;
}
else
{
- torus_query = "ip encloses/net.ipaddress \"";
+ torus_query = "ipRanges encloses/net.ipaddress \"";
torus_query += escape_cql_term(std::string(ip));
torus_query += "\"";
+
+ if (m_p->torus_auth_hostname.length())
+ {
+ torus_query += " AND hostName == \"";
+ torus_query += escape_cql_term(m_p->torus_auth_hostname);
+ torus_query += "\"";
+ }
failure_code = YAZ_BIB1_INIT_AC_BLOCKED_NETWORK_ADDRESS;
}