diff options
Diffstat (limited to 'lib/server/TcpNice.cpp')
-rw-r--r-- | lib/server/TcpNice.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/server/TcpNice.cpp b/lib/server/TcpNice.cpp index 20619e49..79e91eeb 100644 --- a/lib/server/TcpNice.cpp +++ b/lib/server/TcpNice.cpp @@ -146,7 +146,7 @@ void NiceSocketStream::Write(const void *pBuffer, int NBytes) int socket = mapSocket->GetSocketHandle(); int rtt = 50; // WAG -# if HAVE_DECL_SOL_TCP && HAVE_DECL_TCP_INFO && HAVE_STRUCT_TCP_INFO_TCPI_RTT +# if HAVE_DECL_SOL_TCP && defined HAVE_STRUCT_TCP_INFO_TCPI_RTT struct tcp_info info; socklen_t optlen = sizeof(info); if(getsockopt(socket, SOL_TCP, TCP_INFO, &info, &optlen) == -1) @@ -154,7 +154,7 @@ void NiceSocketStream::Write(const void *pBuffer, int NBytes) BOX_LOG_SYS_WARNING("getsockopt(" << socket << ", SOL_TCP, " "TCP_INFO) failed"); } - else if(optlen != sizeof(info)) + else if(optlen < sizeof(info)) { BOX_WARNING("getsockopt(" << socket << ", SOL_TCP, " "TCP_INFO) return structure size " << optlen << ", " @@ -164,7 +164,7 @@ void NiceSocketStream::Write(const void *pBuffer, int NBytes) { rtt = info.tcpi_rtt; } -# endif +# endif // HAVE_DECL_SOL_TCP && defined HAVE_STRUCT_TCP_INFO_TCPI_RTT int newWindow = mTcpNice.GetNextWindowSize(mBytesWrittenThisPeriod, elapsed, rtt); |