Skip to content

No fragmenting control frames#29

Merged
ianpartridge merged 4 commits intomasterfrom
noFragmentingControlFrames
Mar 13, 2018
Merged

No fragmenting control frames#29
ianpartridge merged 4 commits intomasterfrom
noFragmentingControlFrames

Conversation

@Andrew-Lees11
Copy link
Copy Markdown
Contributor

By the websockets protocol control frames such as ping, close and pong cannot be fragmented.

This means we should close if we receive a control frame which has a continuation.

Since pong and close will close already we have only changed ping.

This now passes autobahn test 5.1 and a test to check this has been added.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 12, 2018

Codecov Report

Merging #29 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #29      +/-   ##
==========================================
+ Coverage   90.64%   90.68%   +0.03%     
==========================================
  Files           9        9              
  Lines         481      483       +2     
==========================================
+ Hits          436      438       +2     
  Misses         45       45
Flag Coverage Δ
#KituraWebSocket 90.68% <100%> (+0.03%) ⬆️
Impacted Files Coverage Δ
Sources/KituraWebSocket/WebSocketConnection.swift 91.7% <100%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7633575...4625406. Read the comment docs.

return
}
guard frame.finalFrame else {
connectionClosed(reason: .protocolError, description: "Control frames cannot be fragmented")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be a bit better to say "Control frames must not be fragmented", to match the language of the spec.

@ianpartridge ianpartridge merged commit e4b0a72 into master Mar 13, 2018
@ianpartridge ianpartridge deleted the noFragmentingControlFrames branch March 13, 2018 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants