Commit dc9d913
committed
Check the opcode of the frame
We implement a system of opcode checking so we can differentiate the
types of frame we are receiving.
In case the opcode is unknown, we close the connection according to RFC
6455: "If an unknown opcode is received, the receiving endpoint MUST
_Fail the WebSocket Connection_."
However, if the opcode is know but we do not support it, we just display
a warning and ignore the frame.
For now on, nothing happens if we receive a PING or PONG frame.
fixed Pithikos#6
Signed-off-by: Olivier Gayot <[email protected]>1 parent 4dae1c1 commit dc9d913
1 file changed
+31
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
102 | 111 | | |
103 | 112 | | |
104 | 113 | | |
| |||
164 | 173 | | |
165 | 174 | | |
166 | 175 | | |
| 176 | + | |
167 | 177 | | |
168 | 178 | | |
169 | 179 | | |
170 | 180 | | |
171 | 181 | | |
172 | | - | |
| 182 | + | |
173 | 183 | | |
174 | 184 | | |
175 | 185 | | |
176 | 186 | | |
177 | 187 | | |
178 | 188 | | |
179 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
180 | 206 | | |
181 | 207 | | |
182 | 208 | | |
| |||
188 | 214 | | |
189 | 215 | | |
190 | 216 | | |
191 | | - | |
| 217 | + | |
192 | 218 | | |
193 | 219 | | |
194 | 220 | | |
| |||
0 commit comments