void ReadSettingsFrame(IChannelHandlerContext ctx, IByteBuffer payload, IHttp2FrameListener listener) { if (_flags.Ack()) { listener.OnSettingsAckRead(ctx); } else { int numSettings = _payloadLength / Http2CodecUtil.SettingEntryLength; Http2Settings settings = new Http2Settings(); for (int index = 0; index < numSettings; ++index) { char id = (char)payload.ReadUnsignedShort(); long value = payload.ReadUnsignedInt(); try { _ = settings.Put(id, value); } catch (ArgumentException e) { switch (id) { case Http2CodecUtil.SettingsMaxFrameSize: ThrowHelper.ThrowConnectionError(Http2Error.ProtocolError, e); break; case Http2CodecUtil.SettingsInitialWindowSize: ThrowHelper.ThrowConnectionError(Http2Error.FlowControlError, e); break; default: ThrowHelper.ThrowConnectionError(Http2Error.ProtocolError, e); break; } } } listener.OnSettingsRead(ctx, settings); } }
public virtual void OnSettingsAckRead(IChannelHandlerContext ctx) { _listener.OnSettingsAckRead(ctx); }
public void OnSettingsAckRead(IChannelHandlerContext ctx) { _logger.LogSettingsAck(Direction.Inbound, ctx); _listener.OnSettingsAckRead(ctx); }