Fixed to prevent failure with systems that dont support window scaling.

This commit is contained in:
Paul Gregoire 2015-10-28 11:03:31 -04:00
parent da2194444c
commit 847f9a6e4e

View File

@ -390,8 +390,15 @@ public class PseudoTcpTestRecvWindow extends PseudoTcpTestBase
test.setOptNagling(false); test.setOptNagling(false);
test.setOptAckDelay(0); test.setOptAckDelay(0);
int wndSize = 300000; 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.setRemoteOptRcvBuf(wndSize);
test.setLocalOptSndBuf(wndSize);
int wndScale = test.getRemoteScaleFactor(); int wndScale = test.getRemoteScaleFactor();
//logger.log(Level.INFO, "Using scale factor: {0}", wndScale); //logger.log(Level.INFO, "Using scale factor: {0}", wndScale);
test.doTestTransfer(1024 * 3000); test.doTestTransfer(1024 * 3000);