/* This file is part of Metaproxy.
- Copyright (C) 2005-2011 Index Data
+ Copyright (C) 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
}
// define Pimpl wrapper forwarding to Impl
-
+
yf::Limit::Limit() : m_p(new Impl)
{
}
{ // must have a destructor because of boost::scoped_ptr
}
-void yf::Limit::configure(const xmlNode *xmlnode, bool test_only)
+void yf::Limit::configure(const xmlNode *xmlnode, bool test_only,
+ const char *path)
{
m_p->configure(xmlnode);
}
}
yf::Limit::Impl::~Impl()
-{
+{
}
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));
}
yf::Limit::Ses *ses = 0;
- std::map<mp::Session,yf::Limit::Ses *>::iterator it =
+ std::map<mp::Session,yf::Limit::Ses *>::iterator it =
m_sessions.find(package.session());
if (it != m_sessions.end())
ses = it->second;
yf::Limit::Ses *ses = 0;
- std::map<mp::Session,yf::Limit::Ses *>::iterator it =
+ std::map<mp::Session,yf::Limit::Ses *>::iterator it =
m_sessions.find(package.session());
if (it != m_sessions.end())
ses = it->second;
}
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)