use of com.webpieces.http2engine.impl.shared.data.HeaderSettings in project webpieces by deanhiller.
the class Requests method createSomeSettings.
public static HeaderSettings createSomeSettings() {
HeaderSettings settings = new HeaderSettings();
settings.setHeaderTableSize(4099);
settings.setInitialWindowSize(5009);
settings.setMaxConcurrentStreams(1L);
settings.setMaxFrameSize(16385);
settings.setMaxHeaderListSize(5222);
settings.setPushEnabled(true);
return settings;
}
use of com.webpieces.http2engine.impl.shared.data.HeaderSettings in project webpieces by deanhiller.
the class AbstractHttp2Test method simulateClientSendingPrefaceAndSettings.
protected void simulateClientSendingPrefaceAndSettings() {
//this method is overloaded by one test
HeaderSettings settings = Http2Requests.createSomeSettings();
mockChannel.sendPrefaceAndSettings(HeaderSettings.createSettingsFrame(settings));
List<Http2Msg> frames = mockChannel.getFramesAndClear();
Assert.assertEquals(2, frames.size());
}
use of com.webpieces.http2engine.impl.shared.data.HeaderSettings in project webpieces by deanhiller.
the class TestS3InitialHttpConnections method testSection3_4WithH2cTokenPriorKnowledge.
/**
* Only will work with webpieces and 'jetty with alpn installed'
*
* should send PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n
* and server sends back it's preface...
* The server connection preface consists of a potentially empty SETTINGS
* frame (Section 6.5) that MUST be the first frame the server sends in the HTTP/2 connection.
*
* SettingsFrame{streamId=0, ack=false, settings=[{SETTINGS_HEADER_TABLE_SIZE: 4096}, {SETTINGS_MAX_CONCURRENT_STREAMS: 1024}, {SETTINGS_INITIAL_WINDOW_SIZE: 65535}, {SETTINGS_MAX_HEADER_LIST_SIZE: 8192}]}
* SettingsFrame{streamId=0, ack=true, settings=[]}
*/
@Test
public void testSection3_4WithH2cTokenPriorKnowledge() {
HeaderSettings settings = Http2Requests.createSomeSettings();
mockChannel.sendPrefaceAndSettings(HeaderSettings.createSettingsFrame(settings));
List<Http2Msg> frames = mockChannel.getFramesAndClear();
Assert.assertEquals(2, frames.size());
SettingsFrame serverSettings = (SettingsFrame) frames.get(0);
Assert.assertFalse(serverSettings.isAck());
SettingsFrame ackClientSettings = (SettingsFrame) frames.get(1);
Assert.assertTrue(ackClientSettings.isAck());
}
use of com.webpieces.http2engine.impl.shared.data.HeaderSettings in project webpieces by deanhiller.
the class Http2Requests method createSomeSettings.
public static HeaderSettings createSomeSettings() {
HeaderSettings settings = new HeaderSettings();
settings.setHeaderTableSize(4099);
settings.setInitialWindowSize(5009);
settings.setMaxConcurrentStreams(1L);
settings.setMaxFrameSize(16385);
settings.setMaxHeaderListSize(5222);
settings.setPushEnabled(true);
return settings;
}
use of com.webpieces.http2engine.impl.shared.data.HeaderSettings in project webpieces by deanhiller.
the class TestSMaxConcurrentSetting method testSend2ndPushHeadersOnlyOnAfterSettingsFrameMaxConcurrentBigger.
@Test
public void testSend2ndPushHeadersOnlyOnAfterSettingsFrameMaxConcurrentBigger() throws InterruptedException, ExecutionException, TimeoutException {
WriterHolder sent = sendTwoRequests();
//client increases max concurrent
HeaderSettings settings = new HeaderSettings();
settings.setMaxConcurrentStreams(2L);
mockChannel.send(HeaderSettings.createSettingsFrame(settings));
List<Http2Msg> frames = mockChannel.getFramesAndClear();
Assert.assertEquals(2, frames.size());
Assert.assertEquals(sent.getResp2(), frames.get(0));
SettingsFrame dataRecv1 = (SettingsFrame) frames.get(1);
Assert.assertTrue(dataRecv1.isAck());
StreamWriter writer2 = sent.getFuture2().get(2, TimeUnit.SECONDS);
DataFrame data2 = Http2Requests.createData1(sent.getResp2().getStreamId(), true);
writer2.processPiece(data2);
DataFrame dataRecv2 = (DataFrame) mockChannel.getFrameAndClear();
Assert.assertEquals(sent.getResp2().getStreamId(), dataRecv2.getStreamId());
}
Aggregations