@@ -27,8 +27,22 @@ class Settings
27
27
:maximum_header_list_size= ,
28
28
nil ,
29
29
:enable_connect_protocol= ,
30
+ :no_rfc7540_priorities= ,
30
31
]
31
32
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
+
32
46
# Allows the sender to inform the remote endpoint of the maximum size of the header compression table used to decode header blocks, in octets.
33
47
attr_accessor :header_table_size
34
48
@@ -91,16 +105,18 @@ def enable_connect_protocol?
91
105
@enable_connect_protocol == 1
92
106
end
93
107
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
104
120
end
105
121
106
122
def update ( changes )
@@ -110,40 +126,6 @@ def update(changes)
110
126
end
111
127
end
112
128
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
147
129
end
148
130
149
131
class PendingSettings
0 commit comments