From e55d02d0c0a3d7c2f17fa224442478d2bfde501c Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 5 Mar 2012 14:09:54 +0100 Subject: [PATCH] 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. --- src/filter_zoom.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 1.7.10.4