X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Ffilter_session_shared.cpp;h=6319c3560699e3ffdab2cdb7d92726e22d0549aa;hb=68077fb163a5a274e1e9dbf9762d4e4bc71dc7f2;hp=d298d856a79faf103e632564f432994a9978e526;hpb=da353f48b13fd79e446570d120369423f9c496dd;p=metaproxy-moved-to-github.git diff --git a/src/filter_session_shared.cpp b/src/filter_session_shared.cpp index d298d85..6319c35 100644 --- a/src/filter_session_shared.cpp +++ b/src/filter_session_shared.cpp @@ -1,8 +1,20 @@ -/* $Id: filter_session_shared.cpp,v 1.17 2007-02-23 18:58:44 marc Exp $ - Copyright (c) 2005-2007, Index Data. +/* This file is part of Metaproxy. + Copyright (C) 2005-2008 Index Data - See the LICENSE file for details - */ +Metaproxy is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ #include "config.hpp" @@ -407,14 +419,10 @@ void yf::SessionShared::Rep::init(mp::Package &package, const Z_GDU *gdu, m_session_ttl)); m_backend_map[k] = b; frontend->m_backend_class = b; - std::cout << "SessionShared::Rep::init new session " - << frontend->m_backend_class << "\n"; } else { frontend->m_backend_class = it->second; - std::cout << "SessionShared::Rep::init existing session " - << frontend->m_backend_class << "\n"; } } BackendClassPtr bc = frontend->m_backend_class; @@ -566,7 +574,6 @@ void yf::SessionShared::Frontend::override_set( found_backend = *it; result_set_id = (*set_it)->m_result_set_id; found_backend->m_sets.erase(set_it); - std::cout << "REUSE TTL SET: " << result_set_id << "\n"; return; } } @@ -587,7 +594,6 @@ void yf::SessionShared::Frontend::override_set( } else result_set_id = "default"; - std::cout << "AVAILABLE SET: " << result_set_id << "\n"; return; } } @@ -622,8 +628,6 @@ void yf::SessionShared::Frontend::get_set(mp::Package &package, found_backend = *it; bc->use_backend(found_backend); found_set->timestamp(); - std::cout << "MATCH SET: " << - found_set->m_result_set_id << "\n"; // found matching set. No need to search again return; } @@ -661,8 +665,6 @@ void yf::SessionShared::Frontend::get_set(mp::Package &package, package.response() = f_apdu; return; } - std::cout << "NEW " << found_backend << "\n"; - if (bc->m_named_result_sets) { result_set_id = boost::io::str( @@ -671,14 +673,12 @@ void yf::SessionShared::Frontend::get_set(mp::Package &package, } else result_set_id = "default"; - std::cout << "NEW SET: " << result_set_id << "\n"; } // we must search ... BackendSetPtr new_set(new BackendSet(result_set_id, databases, query)); if (!new_set->search(package, apdu_req, found_backend)) { - std::cout << "search error\n"; bc->remove_backend(found_backend); return; // search error } @@ -860,12 +860,10 @@ void yf::SessionShared::BackendClass::expire() BackendInstanceList::iterator bit = m_backend_list.begin(); while (bit != m_backend_list.end()) { - std::cout << "expiry "; time_t last_use = (*bit)->m_time_last_use; if ((*bit)->m_in_use) { - std::cout << "inuse"; bit++; } else if ((now >= last_use && now - last_use > m_backend_expiry_ttl) @@ -878,14 +876,11 @@ void yf::SessionShared::BackendClass::expire() (*bit)->m_close_package->move(); bit = m_backend_list.erase(bit); - std::cout << "erase"; } else { - std::cout << "keep"; bit++; } - std::cout << std::endl; } } @@ -897,7 +892,6 @@ void yf::SessionShared::Rep::expire() boost::xtime_get(&xt, boost::TIME_UTC); xt.sec += 30; boost::thread::sleep(xt); - //std::cout << "." << std::endl; BackendClassMap::const_iterator b_it = m_backend_map.begin(); for (; b_it != m_backend_map.end(); b_it++) @@ -1038,7 +1032,7 @@ void yf::SessionShared::process(mp::Package &package) const m_p->release_frontend(package); } -void yf::SessionShared::configure(const xmlNode *ptr) +void yf::SessionShared::configure(const xmlNode *ptr, bool test_only) { for (ptr = ptr->children; ptr; ptr = ptr->next) {