Unverified Commit 6c9c0802 authored by Zhangyi Chen's avatar Zhangyi Chen Committed by GitHub

Merge pull request #655 from mikeyang2015/master

fix rtt display in connection page
parents 96f2fcc7 f4e791b4
...@@ -255,12 +255,16 @@ void ConnectionsService::PrintConnections( ...@@ -255,12 +255,16 @@ void ConnectionsService::PrintConnections(
socklen_t len = sizeof(ti); socklen_t len = sizeof(ti);
if (0 == getsockopt(rttfd, SOL_TCP, TCP_INFO, &ti, &len)) { if (0 == getsockopt(rttfd, SOL_TCP, TCP_INFO, &ti, &len)) {
got_rtt = true; got_rtt = true;
srtt = ti.tcpi_rtt;
rtt_var = ti.tcpi_rttvar;
} }
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
struct tcp_connection_info ti; struct tcp_connection_info ti;
socklen_t len = sizeof(ti); socklen_t len = sizeof(ti);
if (0 == getsockopt(rttfd, IPPROTO_TCP, TCP_CONNECTION_INFO, &ti, &len)) { if (0 == getsockopt(rttfd, IPPROTO_TCP, TCP_CONNECTION_INFO, &ti, &len)) {
got_rtt = true; got_rtt = true;
srtt = ti.tcpi_srtt;
rtt_var = ti.tcpi_rttvar;
} }
#endif #endif
char rtt_display[32]; char rtt_display[32];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment