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

Method readSettingsFrame

java/org/apache/coyote/http2/Http2Parser.java:338–368  ·  view source on GitHub ↗
(int flags, int payloadSize, ByteBuffer buffer)

Source from the content-addressed store, hash-verified

336
337
338 protected void readSettingsFrame(int flags, int payloadSize, ByteBuffer buffer) throws Http2Exception, IOException {
339 boolean ack = Flags.isAck(flags);
340 if (payloadSize > 0 && ack) {
341 throw new ConnectionException(sm.getString("http2Parser.processFrameSettings.ackWithNonZeroPayload"),
342 Http2Error.FRAME_SIZE_ERROR);
343 }
344
345 if (payloadSize == 0 && !ack) {
346 // Ensure empty SETTINGS frame increments the overhead count
347 output.setting(null, 0);
348 } else {
349 // Process the settings
350 byte[] setting = new byte[6];
351 for (int i = 0; i < payloadSize / 6; i++) {
352 if (buffer == null) {
353 input.fill(true, setting);
354 } else {
355 buffer.get(setting);
356 }
357 int id = ByteUtil.getTwoBytes(setting, 0);
358 long value = ByteUtil.getFourBytes(setting, 2);
359 Setting key = Setting.valueOf(id);
360 if (key == Setting.UNKNOWN) {
361 log.warn(sm.getString("connectionSettings.unknown", connectionId, Integer.toString(id),
362 Long.toString(value)));
363 }
364 output.setting(key, value);
365 }
366 }
367 output.settingsEnd(ack);
368 }
369
370
371 /**

Callers 3

readFrameMethod · 0.95
completedMethod · 0.80
completedMethod · 0.80

Calls 11

isAckMethod · 0.95
getTwoBytesMethod · 0.95
getFourBytesMethod · 0.95
valueOfMethod · 0.95
getStringMethod · 0.65
settingMethod · 0.65
fillMethod · 0.65
getMethod · 0.65
warnMethod · 0.65
toStringMethod · 0.65
settingsEndMethod · 0.65

Tested by

no test coverage detected