diff options
author | Reinhard Tartler <siretart@tauware.de> | 2018-02-20 21:49:13 -0500 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2018-02-20 21:49:13 -0500 |
commit | f28f88e5e72ba1499409047a9d6985eb312c0232 (patch) | |
tree | c9c267f18264b3dfe715a363935bb6ac20904492 /lib/server/TcpNice.cpp | |
parent | e19a5db232e1ef90e9a02159d2fbd9707ffe4373 (diff) | |
parent | 6d7e9562e8485591a4888f1fc2d3c6c657dc7a01 (diff) |
Merge tag 'BoxBackup-0.12.master.180102.6d7e956' into upstream
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); |