X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ffilter_limit.cpp;h=19e93fb2603624e40a2c2dc3db5643698c34b7ad;hb=b1d299c751b81d4c9bc113a0300daf0667063710;hp=0117bf9d752e7b651552b3ba3bdde6adc3003a67;hpb=50597d2f7d3607e91c94601eb8eb495d73be3eae;p=metaproxy-moved-to-github.git diff --git a/src/filter_limit.cpp b/src/filter_limit.cpp index 0117bf9..19e93fb 100644 --- a/src/filter_limit.cpp +++ b/src/filter_limit.cpp @@ -1,5 +1,5 @@ /* This file is part of Metaproxy. - Copyright (C) 2005-2012 Index Data + Copyright (C) 2005-2013 Index Data 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 @@ -59,7 +59,7 @@ namespace metaproxy_1 { } // define Pimpl wrapper forwarding to Impl - + yf::Limit::Limit() : m_p(new Impl) { } @@ -88,7 +88,7 @@ yf::Limit::Impl::Impl() : m_bw_max(0), m_pdu_max(0), m_search_max(0), } yf::Limit::Impl::~Impl() -{ +{ } void yf::Limit::Impl::configure(const xmlNode *ptr) @@ -119,7 +119,7 @@ void yf::Limit::Impl::configure(const xmlNode *ptr) } else { - throw mp::filter::FilterException("Bad element " + throw mp::filter::FilterException("Bad element " + std::string((const char *) ptr->name)); } @@ -134,7 +134,7 @@ void yf::Limit::Impl::process(mp::Package &package) yf::Limit::Ses *ses = 0; - std::map::iterator it = + std::map::iterator it = m_sessions.find(package.session()); if (it != m_sessions.end()) ses = it->second; @@ -172,7 +172,7 @@ void yf::Limit::Impl::process(mp::Package &package) yf::Limit::Ses *ses = 0; - std::map::iterator it = + std::map::iterator it = m_sessions.find(package.session()); if (it != m_sessions.end()) ses = it->second; @@ -183,14 +183,14 @@ void yf::Limit::Impl::process(mp::Package &package) } sz += package.response().get_size(); - + ses->bw_stat.add_bytes(sz); ses->pdu_stat.add_bytes(1); - + int bw_total = ses->bw_stat.get_total(); int pdu_total = ses->pdu_stat.get_total(); int search_total = ses->search_stat.get_total(); - + if (m_search_max) reduce += search_total / m_search_max; if (m_bw_max)