class PendingSettings
Manages pending settings changes that haven't been acknowledged yet.
Definitions
def initialize(current = Settings.new)
Initialize with current settings.
Signature
-
parameter
current
Settings
The current settings object.
Implementation
def initialize(current = Settings.new)
@current = current
@pending = current.dup
@queue = []
end
def append(changes)
Append changes to the pending queue.
Signature
-
parameter
changes
Hash
Hash of setting changes to queue.
Implementation
def append(changes)
@queue << changes
@pending.update(changes)
end
def acknowledge
Acknowledge the next set of pending changes.
Implementation
def acknowledge
if changes = @queue.shift
@current.update(changes)
return changes
else
raise ProtocolError, "Cannot acknowledge settings, no changes pending"
end
end
def header_table_size
Get the current header table size setting.
Signature
-
returns
Integer
The header table size in octets.
Implementation
def header_table_size
@current.header_table_size
end
def enable_push
Get the current enable push setting.
Signature
-
returns
Integer
1 if push is enabled, 0 if disabled.
Implementation
def enable_push
@current.enable_push
end
def maximum_concurrent_streams
Get the current maximum concurrent streams setting.
Signature
-
returns
Integer
The maximum number of concurrent streams.
Implementation
def maximum_concurrent_streams
@current.maximum_concurrent_streams
end
def initial_window_size
Get the current initial window size setting.
Signature
-
returns
Integer
The initial window size in octets.
Implementation
def initial_window_size
@current.initial_window_size
end
def maximum_frame_size
Get the current maximum frame size setting.
Signature
-
returns
Integer
The maximum frame size in octets.
Implementation
def maximum_frame_size
@current.maximum_frame_size
end
def maximum_header_list_size
Get the current maximum header list size setting.
Signature
-
returns
Integer
The maximum header list size in octets.
Implementation
def maximum_header_list_size
@current.maximum_header_list_size
end
def enable_connect_protocol
Get the current CONNECT protocol enable setting.
Signature
-
returns
Integer
1 if CONNECT protocol is enabled, 0 if disabled.
Implementation
def enable_connect_protocol
@current.enable_connect_protocol
end