96 for (ptr = ptr->children; ptr; ptr = ptr->next)
98 if (ptr->type != XML_ELEMENT_NODE)
100 if (!strcmp((
const char *) ptr->name,
"limit"))
102 const struct _xmlAttr *attr;
103 for (attr = ptr->properties; attr; attr = attr->next)
105 if (!strcmp((
const char *) attr->name,
"bandwidth"))
106 m_bw_max = mp::xml::get_int(attr->children, 0);
107 else if (!strcmp((
const char *) attr->name,
"pdu"))
108 m_pdu_max = mp::xml::get_int(attr->children, 0);
109 else if (!strcmp((
const char *) attr->name,
"search"))
111 else if (!strcmp((
const char *) attr->name,
"retrieve"))
113 mp::xml::get_int(attr->children, 0);
115 throw mp::filter::FilterException(
116 "Bad attribute " + std::string((
const char *)
122 throw mp::filter::FilterException(
"Bad element "
123 + std::string((
const char *)
137 std::map<mp::Session,yf::Limit::Ses *>::iterator it =
148 Z_GDU *
gdu = package.request().get();
149 if (
gdu &&
gdu->which == Z_GDU_Z3950)
151 sz += package.request().get_size();
153 Z_APDU *apdu =
gdu->u.z3950;
154 if (apdu->which == Z_APDU_searchRequest)
158 if (apdu->which == Z_APDU_presentRequest)
160 Z_PresentRequest *pr = apdu->u.presentRequest;
161 if (pr->numberOfRecordsRequested &&
175 std::map<mp::Session,yf::Limit::Ses *>::iterator it =
185 sz += package.response().get_size();
190 int bw_total = ses->
bw_stat.get_total();
191 int pdu_total = ses->
pdu_stat.get_total();
203 reduce = (reduce > nreduce) ? reduce : nreduce;
206 if (package.session().is_closed())
214 std::ostringstream os;
220 yaz_log(YLOG_LOG,
"%s", os.str().c_str());
222 Sleep(reduce * 1000);