Merge pull request #40 from mondain/master

Prevent test failure on systems that dont support window scaling.
This commit is contained in:
Ingo Bauersachs 2015-10-30 07:17:45 +01:00
commit 5dbac4599d

View File

@ -390,8 +390,15 @@ public class PseudoTcpTestRecvWindow extends PseudoTcpTestBase
test.setOptNagling(false);
test.setOptAckDelay(0);
int wndSize = 300000;
// if window scaling is not supported by either local or remote, use
// default size
if (!test.getLocalTcp().m_support_wnd_scale ||
!test.getRemoteTcp().m_support_wnd_scale)
{
wndSize = 65535;
}
test.setLocalOptSndBuf(wndSize);
test.setRemoteOptRcvBuf(wndSize);
test.setLocalOptSndBuf(wndSize);
int wndScale = test.getRemoteScaleFactor();
//logger.log(Level.INFO, "Using scale factor: {0}", wndScale);
test.doTestTransfer(1024 * 3000);