X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Ffilter_frontend_net.cpp;h=e94998ca3e241748fc28dd4756936f153b752504;hb=146b834236c9b6f73d2d6e5296095360ee026f56;hp=c0f27ef942dadbd27ac22ab4f742cb13e4724fe8;hpb=102cab997609bf96205b0831eb71fc6fe9bb732a;p=metaproxy-moved-to-github.git diff --git a/src/filter_frontend_net.cpp b/src/filter_frontend_net.cpp index c0f27ef..e94998c 100644 --- a/src/filter_frontend_net.cpp +++ b/src/filter_frontend_net.cpp @@ -32,6 +32,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include #include +#include "gduutil.hpp" #include @@ -212,11 +213,17 @@ void mp::ThreadPoolPackage::result(const char *t_info) { yaz_timing_stop(timer); double duration = yaz_timing_get_real(timer); + Z_GDU *z_gdu = gdu->get(); std::ostringstream os; os << m_msg_config << " " << *m_package << " " - << std::fixed << std::setprecision (6) << duration; + << std::fixed << std::setprecision (6) << duration << " "; + + if (z_gdu) + os << *z_gdu; + else + os << "-"; yaz_log(YLOG_LOG, "%s %s", os.str().c_str(), t_info); } @@ -270,6 +277,19 @@ void mp::ZAssocChild::recv_GDU(Z_GDU *z_pdu, int len) m_msg_config); p->copy_route(*m_package); p->request() = yazpp_1::GDU(z_pdu); + + if (m_msg_config) + { + if (z_pdu) + { + std::ostringstream os; + os << m_msg_config << " " + << *p << " " + << "0.000000" << " " + << *z_pdu; + yaz_log(YLOG_LOG, "%s", os.str().c_str()); + } + } m_thread_pool_observer->put(tp); } @@ -436,7 +456,8 @@ void mp::filter::FrontendNet::process(Package &package) const } while (m_p->mySocketManager.processEvent() > 0) { - if (m_p->mySocketManager.getNumberOfObservers() <= 1) + int no = m_p->mySocketManager.getNumberOfObservers(); + if (no <= 1) break; if (tt && tt->timeout()) break;