public HTTP2SettingsRegistry(HTTP2SettingsManager parent, bool readOnly, bool treatItAsAlreadyChanged) { this._parent = parent; this.values = new UInt32[HTTP2SettingsManager.SettingsCount]; this.IsReadOnly = readOnly; if (!this.IsReadOnly) { this.changeFlags = new bool[HTTP2SettingsManager.SettingsCount]; } // Set default values (https://httpwg.org/specs/rfc7540.html#iana-settings) this.values[(UInt16)HTTP2Settings.HEADER_TABLE_SIZE] = 4096; this.values[(UInt16)HTTP2Settings.ENABLE_PUSH] = 1; this.values[(UInt16)HTTP2Settings.MAX_CONCURRENT_STREAMS] = 128; this.values[(UInt16)HTTP2Settings.INITIAL_WINDOW_SIZE] = 65535; this.values[(UInt16)HTTP2Settings.MAX_FRAME_SIZE] = 16384; this.values[(UInt16)HTTP2Settings.MAX_HEADER_LIST_SIZE] = UInt32.MaxValue; // infinite if (this.IsChanged = treatItAsAlreadyChanged) { this.changeFlags[(UInt16)HTTP2Settings.MAX_CONCURRENT_STREAMS] = true; } }
public HPACKEncoder(HTTP2SettingsManager registry) { this.settingsRegistry = registry; // I'm unsure what settings (local or remote) we should use for these two tables! this.requestTable = new HeaderTable(this.settingsRegistry.MySettings); this.responseTable = new HeaderTable(this.settingsRegistry.RemoteSettings); }
public HTTP2Stream(HTTP2SettingsManager registry, HPACKEncoder hpackEncoder, UInt32 id) { this.settings = registry; this.encoder = hpackEncoder; this.Id = id; this.remoteWindow = this.settings.RemoteSettings[HTTP2Settings.INITIAL_WINDOW_SIZE]; this.settings.RemoteSettings.OnSettingChangedEvent += OnRemoteSettingChanged; // Room for improvement: If INITIAL_WINDOW_SIZE is small (what we can consider a 'small' value?), threshold must be higher this.windowUpdateThreshold = (uint)(this.remoteWindow / 2); }
public HTTP2Handler(HTTPConnection conn) { this.Context = new LoggingContext(this); this.conn = conn; this.isRunning = true; this.settings = new HTTP2SettingsManager(this); // Put the first request to the queue this.requestQueue.Enqueue(conn.CurrentRequest); }
/// <summary> /// Constructor to create a client stream. /// </summary> public HTTP2Stream(HTTP2SettingsManager registry, HPACKEncoder hpackEncoder) : this(registry, hpackEncoder, (UInt32)Interlocked.Add(ref LastStreamId, 2)) { }