From: Adam Dickmeiss Date: Mon, 5 Mar 2012 13:09:54 +0000 (+0100) Subject: zoom: re-connect when database is reused X-Git-Tag: v1.3.26~23 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=e55d02d0c0a3d7c2f17fa224442478d2bfde501c;p=metaproxy-moved-to-github.git zoom: re-connect when database is reused Re-connect is necessary if a connection is lost or a timeout occurs. If not, we'll be seeing zero hits, when we shouldn't. --- diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index aaa9ef5..e8e1681 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -322,7 +322,7 @@ void yf::Zoom::Backend::connect(std::string zurl, int *error, char **addinfo, ODR odr) { - ZOOM_connection_connect(m_connection, zurl.c_str(), 0); + ZOOM_connection_connect(m_connection, zurl.length() ? zurl.c_str() : 0, 0); get_zoom_error(error, addinfo, odr); } @@ -872,7 +872,10 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( std::list::const_iterator map_it; if (m_backend && !m_backend->enable_explain && m_backend->m_frontend_database == database) + { + m_backend->connect("", error, addinfo, odr); return m_backend; + } std::string input_args; std::string torus_db;