From 67345bf565259ce40259abbae89f98907369e645 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 23 Mar 2009 12:10:14 +0100 Subject: [PATCH] Implement Session invalidate for -1 hits (bug #2696). --- src/filter_session_shared.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/filter_session_shared.cpp b/src/filter_session_shared.cpp index b7e5235..57b7337 100644 --- a/src/filter_session_shared.cpp +++ b/src/filter_session_shared.cpp @@ -629,6 +629,9 @@ void yf::SessionShared::Frontend::get_set(mp::Package &package, BackendInstancePtr &found_backend, BackendSetPtr &found_set) { + bool session_restarted = false; + +restart: std::string result_set_id; BackendClassPtr bc = m_backend_class; { @@ -709,6 +712,14 @@ void yf::SessionShared::Frontend::get_set(mp::Package &package, bc->release_backend(found_backend); return; // search error } + if (!session_restarted && new_set->m_result_set_size < 0) + { + bc->remove_backend(found_backend); + session_restarted = true; + found_backend.reset(); + goto restart; + } + found_set = new_set; found_set->timestamp(); found_backend->m_sets.push_back(found_set); -- 1.7.10.4