@@ -27,8 +27,22 @@ class Settings
2727 :maximum_header_list_size= ,
2828 nil ,
2929 :enable_connect_protocol= ,
30+ :no_rfc7540_priorities= ,
3031 ]
3132
33+ def initialize
34+ # These limits are taken from the RFC:
35+ # https://tools.ietf.org/html/rfc7540#section-6.5.2
36+ @header_table_size = 4096
37+ @enable_push = 1
38+ @maximum_concurrent_streams = 0xFFFFFFFF
39+ @initial_window_size = 0xFFFF # 2**16 - 1
40+ @maximum_frame_size = 0x4000 # 2**14
41+ @maximum_header_list_size = 0xFFFFFFFF
42+ @enable_connect_protocol = 0
43+ @no_rfc7540_priorities = 0
44+ end
45+
3246 # Allows the sender to inform the remote endpoint of the maximum size of the header compression table used to decode header blocks, in octets.
3347 attr_accessor :header_table_size
3448
@@ -91,16 +105,18 @@ def enable_connect_protocol?
91105 @enable_connect_protocol == 1
92106 end
93107
94- def initialize
95- # These limits are taken from the RFC:
96- # https://tools.ietf.org/html/rfc7540#section-6.5.2
97- @header_table_size = 4096
98- @enable_push = 1
99- @maximum_concurrent_streams = 0xFFFFFFFF
100- @initial_window_size = 0xFFFF # 2**16 - 1
101- @maximum_frame_size = 0x4000 # 2**14
102- @maximum_header_list_size = 0xFFFFFFFF
103- @enable_connect_protocol = 0
108+ attr :no_rfc7540_priorities
109+
110+ def no_rfc7540_priorities = value
111+ if value == 0 or value == 1
112+ @no_rfc7540_priorities = value
113+ else
114+ raise ProtocolError , "Invalid value for no_rfc7540_priorities: #{ value } "
115+ end
116+ end
117+
118+ def no_rfc7540_priorities?
119+ @no_rfc7540_priorities == 1
104120 end
105121
106122 def update ( changes )
@@ -110,40 +126,6 @@ def update(changes)
110126 end
111127 end
112128 end
113-
114- def difference ( other )
115- changes = [ ]
116-
117- if @header_table_size != other . header_table_size
118- changes << [ HEADER_TABLE_SIZE , @header_table_size ]
119- end
120-
121- if @enable_push != other . enable_push
122- changes << [ ENABLE_PUSH , @enable_push ]
123- end
124-
125- if @maximum_concurrent_streams != other . maximum_concurrent_streams
126- changes << [ MAXIMUM_CONCURRENT_STREAMS , @maximum_concurrent_streams ]
127- end
128-
129- if @initial_window_size != other . initial_window_size
130- changes << [ INITIAL_WINDOW_SIZE , @initial_window_size ]
131- end
132-
133- if @maximum_frame_size != other . maximum_frame_size
134- changes << [ MAXIMUM_FRAME_SIZE , @maximum_frame_size ]
135- end
136-
137- if @maximum_header_list_size != other . maximum_header_list_size
138- changes << [ MAXIMUM_HEADER_LIST_SIZE , @maximum_header_list_size ]
139- end
140-
141- if @enable_connect_protocol != other . enable_connect_protocol
142- changes << [ ENABLE_CONNECT_PROTOCOL , @enable_connect_protocol ]
143- end
144-
145- return changes
146- end
147129 end
148130
149131 class PendingSettings
0 commit comments