Updated Branches: refs/heads/master dfb98be05 -> a1d9f286b
TS-1223: fix the crash in http_ui show network connections Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a1d9f286 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a1d9f286 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a1d9f286 Branch: refs/heads/master Commit: a1d9f286bdb707ebd9feb477e0aea7c3dce9d832 Parents: dfb98be Author: Chen Bin <[email protected]> Authored: Mon Oct 22 21:22:04 2012 +0800 Committer: Zhao Yongming <[email protected]> Committed: Mon Oct 22 21:22:04 2012 +0800 ---------------------------------------------------------------------- CHANGES | 2 ++ iocore/net/P_UnixNetVConnection.h | 1 + iocore/net/UnixNetPages.cc | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a1d9f286/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 2752d36..9705af5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 3.3.1 + *) [TS-1223] fix the crash in http_ui show network connections + *) [TS-1543] Enable non-debug logging for rfc5861 plugin *) [TS-1512] get volume & hosting work with cluster http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a1d9f286/iocore/net/P_UnixNetVConnection.h ---------------------------------------------------------------------- diff --git a/iocore/net/P_UnixNetVConnection.h b/iocore/net/P_UnixNetVConnection.h index 72df73e..93f74ba 100644 --- a/iocore/net/P_UnixNetVConnection.h +++ b/iocore/net/P_UnixNetVConnection.h @@ -196,6 +196,7 @@ public: NetState read; NetState write; + LINK(UnixNetVConnection, show_link); LINK(UnixNetVConnection, cop_link); LINKM(UnixNetVConnection, read, ready_link) SLINKM(UnixNetVConnection, read, enable_link) http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a1d9f286/iocore/net/UnixNetPages.cc ---------------------------------------------------------------------- diff --git a/iocore/net/UnixNetPages.cc b/iocore/net/UnixNetPages.cc index dfcc28f..e5b39c2 100644 --- a/iocore/net/UnixNetPages.cc +++ b/iocore/net/UnixNetPages.cc @@ -62,7 +62,12 @@ struct ShowNet: public ShowCont } ink_hrtime now = ink_get_hrtime(); - forl_LL(UnixNetVConnection, vc, nh->open_list) { + DList(UnixNetVConnection, show_link) show_list; + forl_LL(UnixNetVConnection, vc, nh->open_list) + show_list.push(vc); + while (UnixNetVConnection *vc = show_list.pop()) { + if (vc->closed) + continue; // uint16_t port = ats_ip_port_host_order(&addr.sa); if (ats_is_ip(&addr) && addr != vc->server_addr) continue; @@ -168,8 +173,13 @@ struct ShowNet: public ShowCont CHECK_SHOW(show("<H3>Thread: %d</H3>\n", ithread)); CHECK_SHOW(show("<table border=1>\n")); int connections = 0; + DList(UnixNetVConnection, show_link) show_list; forl_LL(UnixNetVConnection, vc, nh->open_list) - connections++; + show_list.push(vc); + while (UnixNetVConnection *vc = show_list.pop()) { + if (!vc->closed) + connections++; + } CHECK_SHOW(show("<tr><td>%s</td><td>%d</td></tr>\n", "Connections", connections)); //CHECK_SHOW(show("<tr><td>%s</td><td>%d</td></tr>\n", "Last Poll Size", pollDescriptor->nfds)); CHECK_SHOW(show("<tr><td>%s</td><td>%d</td></tr>\n", "Last Poll Ready", pollDescriptor->result));
