X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Ffilter_frontend_net.cpp;h=3246eec922ac4cdac2609b797bb6995c0ec76b13;hb=3573d46e04b1f5061719091bd18d09ce8a944606;hp=b9526c5ad8a68f138c68afdd840fbe90b515c6bb;hpb=069d404cfe3b0d51d1b49edf57cdb3cec180afee;p=metaproxy-moved-to-github.git diff --git a/src/filter_frontend_net.cpp b/src/filter_frontend_net.cpp index b9526c5..3246eec 100644 --- a/src/filter_frontend_net.cpp +++ b/src/filter_frontend_net.cpp @@ -64,6 +64,7 @@ namespace metaproxy_1 { double m_duration_max; double m_duration_min; double m_duration_total; + bool m_stop; public: Rep(); ~Rep(); @@ -302,7 +303,7 @@ void yf::FrontendNet::ZAssocChild::report(Z_HTTP_Request *hreq) number_total += m_p->m_duration_freq[i]; number_total += m_p->m_duration_freq[i]; - wrbuf_puts(w, "\n"); + wrbuf_puts(w, "\n"); wrbuf_puts(w, "\n"); wrbuf_printf(w, " \n", number_total); for (i = 0; m_p->m_duration_lim[i] != 0.0; i++) @@ -334,6 +335,14 @@ void yf::FrontendNet::ZAssocChild::report(Z_HTTP_Request *hreq) m_p->m_duration_total / number_total); wrbuf_puts(w, " \n"); + + int thread_busy; + int thread_total; + m_thread_pool_observer->get_thread_info(thread_busy, thread_total); + + wrbuf_printf(w, " \n", + thread_busy, thread_total); + wrbuf_puts(w, "\n"); hres->content_len = w.len(); @@ -511,6 +520,7 @@ yf::FrontendNet::Rep::Rep() m_duration_max = 0.0; m_duration_min = 0.0; m_duration_total = 0.0; + m_stop = false; } yf::FrontendNet::Rep::~Rep() @@ -531,12 +541,7 @@ yf::FrontendNet::~FrontendNet() void yf::FrontendNet::stop() const { - if (m_p->az) - { - size_t i; - for (i = 0; i < m_p->m_ports.size(); i++) - m_p->az[i]->server(""); - } + m_p->m_stop = true; } bool yf::FrontendNet::My_Timer_Thread::timeout() @@ -580,6 +585,16 @@ void yf::FrontendNet::process(Package &package) const } while (m_p->mySocketManager.processEvent() > 0) { + if (m_p->m_stop) + { + m_p->m_stop = false; + if (m_p->az) + { + size_t i; + for (i = 0; i < m_p->m_ports.size(); i++) + m_p->az[i]->server(""); + } + } int no = m_p->mySocketManager.getNumberOfObservers(); if (no <= 1) break;