Commit f4e791b4 authored by Mengmeng Yang's avatar Mengmeng Yang

fix rtt display in connection page

parent 96f2fcc7
...@@ -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