summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3552169)
This commit also changes the scheme for dealing with proxies a bit.
zoom now always do "proxy-check", even if there's no failover.
Fortunately, that's not very expensive.
BackendPtr b = get_backend_from_databases(package, db, &error,
&addinfo, odr, &proxy_step,
proxy);
BackendPtr b = get_backend_from_databases(package, db, &error,
&addinfo, odr, &proxy_step,
proxy);
- if (error && same_retries == 0)
- if (proxy.length() && proxy_step && !m_p->check_proxy(proxy.c_str()))
- { // we have a failover and the current one seems bad
- proxy_retries++;
- package.log("zoom", YLOG_WARN, "search failed: trying next proxy");
- m_backend.reset();
- goto next_proxy;
+ if (proxy.length() && !m_p->check_proxy(proxy.c_str()))
+ {
+ if (proxy_step) // there is a failover
+ {
+ proxy_retries++;
+ package.log("zoom", YLOG_WARN, "search failed: trying next proxy");
+ m_backend.reset();
+ goto next_proxy;
+ }
+ error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
+ addinfo = odr_strdup(odr, "proxy failure");
- else if (proxy_retries == 0)
+ else if (same_retries == 0 && proxy_retries == 0)
- // only perform retry for same proxy if we've had no other
- // retries at all
- package.log("zoom", YLOG_WARN, "search failed: trying same proxy");
+ package.log("zoom", YLOG_WARN, "search failed: trying first proxy");
m_backend.reset();
proxy_step = 0;
goto next_proxy;
m_backend.reset();
proxy_step = 0;
goto next_proxy;
- if (error && same_retries == 0)
- if (proxy.length() && proxy_step && !m_p->check_proxy(proxy.c_str()))
- { // we have a failover and the current one seems bad
- proxy_retries++;
- package.log("zoom", YLOG_WARN, "search failed: trying next proxy");
- m_backend.reset();
- goto next_proxy;
+ if (proxy.length() && !m_p->check_proxy(proxy.c_str()))
+ {
+ if (proxy_step) // there is a failover
+ {
+ proxy_retries++;
+ package.log("zoom", YLOG_WARN, "search failed: trying next proxy");
+ m_backend.reset();
+ goto next_proxy;
+ }
+ error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
+ addinfo = odr_strdup(odr, "proxy failure");
- else if (proxy_retries == 0)
+ else if (same_retries == 0 && proxy_retries == 0)
- // only perform retry for same proxy if we've had no other
- // retries at all
- package.log("zoom", YLOG_WARN, "search failed: trying same proxy");
+ package.log("zoom", YLOG_WARN, "search failed: trying first proxy");
m_backend.reset();
proxy_step = 0;
goto next_proxy;
m_backend.reset();
proxy_step = 0;
goto next_proxy;