MCPcopy Index your code
hub / github.com/apache/tomcat / sendSettings

Method sendSettings

test/org/apache/coyote/http2/Http2TestBase.java:980–1012  ·  view source on GitHub ↗
(int streamId, boolean ack, SettingValue... settings)

Source from the content-addressed store, hash-verified

978
979
980 void sendSettings(int streamId, boolean ack, SettingValue... settings) throws IOException {
981 // length
982 int settingsCount;
983 if (settings == null) {
984 settingsCount = 0;
985 } else {
986 settingsCount = settings.length;
987 }
988
989 byte[] settingFrame = new byte[9 + 6 * settingsCount];
990
991 ByteUtil.setThreeBytes(settingFrame, 0, 6 * settingsCount);
992 // type
993 settingFrame[3] = FrameType.SETTINGS.getIdByte();
994
995 if (ack) {
996 settingFrame[4] = 0x01;
997 }
998
999 // Stream
1000 ByteUtil.set31Bits(settingFrame, 5, streamId);
1001
1002 // Payload
1003 for (int i = 0; i < settingsCount; i++) {
1004 // Stops IDE complaining about possible NPE
1005 Assert.assertNotNull(settings);
1006 ByteUtil.setTwoBytes(settingFrame, (i * 6) + 9, settings[i].getSetting());
1007 ByteUtil.setFourBytes(settingFrame, (i * 6) + 11, settings[i].getValue());
1008 }
1009
1010 os.write(settingFrame);
1011 os.flush();
1012 }
1013
1014
1015 void handleGoAwayResponse(int lastStream) throws Http2Exception, IOException {

Calls 9

setThreeBytesMethod · 0.95
set31BitsMethod · 0.95
setTwoBytesMethod · 0.95
setFourBytesMethod · 0.95
getIdByteMethod · 0.80
getSettingMethod · 0.80
getValueMethod · 0.65
writeMethod · 0.65
flushMethod · 0.65

Tested by

no test coverage detected