Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the WebSocket handshake ourselves 🍷 #16180

Merged
merged 2 commits into from Mar 29, 2017
Merged

Conversation

nox
Copy link
Contributor

@nox nox commented Mar 29, 2017

HYPE


This change is Reviewable

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @KiChjang: components/net/fetch/methods.rs, components/net/resource_thread.rs, components/net/http_loader.rs, components/net/websocket_loader.rs, components/net_traits/Cargo.toml, components/net_traits/Cargo.toml, components/net_traits/lib.rs, components/net_traits/lib.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 29, 2017
@nox
Copy link
Contributor Author

nox commented Mar 29, 2017

r? @jdm

@highfive highfive assigned jdm and unassigned wafflespeanut Mar 29, 2017
jdm
jdm previously requested changes Mar 29, 2017
Copy link
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

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

Only tiny comments.

let secure = match url.scheme() {
"ws" => false,
"wss" => true,
_ => panic!("URL's scheme should be http or https"),
Copy link
Member

Choose a reason for hiding this comment

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

ws or wss?

// Step 14.6.
let protocol_in_use = if let Some(response_protocols) = response.headers.get::<WebSocketProtocol>() {
for p in &**response_protocols {
if !protocols.contains(p) {
Copy link
Member

Choose a reason for hiding this comment

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

The previous check used eq_ignore_ascii_case. Is this the cause of the new test failure?

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Mar 29, 2017
We need to switch to tungstenite to finally update openssl, this commit
rewrites the whole websocket infrastructure to properly follow the Fetch
spec and to make switching to a different websocket library easier.
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Mar 29, 2017
@jdm
Copy link
Member

jdm commented Mar 29, 2017

@bors-servo: r+

@bors-servo
Copy link
Contributor

📌 Commit d022535 has been approved by jdm

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Mar 29, 2017
@nox nox dismissed jdm’s stale review March 29, 2017 17:20

Comments were addressed.

@nox
Copy link
Contributor Author

nox commented Mar 29, 2017

@bors-servo p=17

@bors-servo
Copy link
Contributor

⌛ Testing commit d022535 with merge 76a2c97...

bors-servo pushed a commit that referenced this pull request Mar 29, 2017
Make the WebSocket handshake ourselves 🍷

HYPE

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16180)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev
Approved by: jdm
Pushing 76a2c97 to master...

@bors-servo bors-servo merged commit d022535 into servo:master Mar 29, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 29, 2017
@nox nox deleted the tungstenite branch March 29, 2017 18:37
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.

None yet

5 participants