Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upstop client websocket close echoing server close #10382
Conversation
highfive
commented
Apr 3, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Apr 3, 2016
| @@ -123,7 +126,9 @@ pub fn init(connect: WebSocketCommunicate, connect_data: WebSocketConnectData, c | |||
| }, | |||
| Type::Pong => continue, | |||
| Type::Close => { | |||
| ws_sender_incoming.lock().unwrap().send_message(&message).unwrap(); | |||
| if client_initiated_close_incoming.load(Ordering::SeqCst) == false { | |||
This comment has been minimized.
This comment has been minimized.
|
r=me with @KiChjang's comment addressed Review status: 0 of 1 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. Comments from Reviewable |
|
Reviewed 1 of 1 files at r1. Comments from Reviewable |
|
@KiChjang's comment addressed. |
|
@bors-servo r+ Reviewed 1 of 1 files at r2. Comments from Reviewable |
|
|
|
@bors-servo r- Please squash and we'll get this merged. +S-needs-squash Review status: all files reviewed at latest revision, 1 unresolved discussion. Comments from Reviewable |
|
Sorry, I'll need to add the guard around https://github.com/bobthekingofegypt/servo/blob/fix-websocket-close/components/net/websocket_loader.rs#L160 as well. As it's still possible to send two close messages. Will get it done tomorrow. |
|
Sorry for the delay, I added the check around both incoming and outgoing. If it's ok, I'll squash all the commits. |
|
Looks good, aside from the comment I left. You can go ahead and squash it at the same time you address that. Reviewed 1 of 1 files at r3. components/net/websocket_loader.rs, line 129 [r3] (raw file): Comments from Reviewable |
|
@bobthekingofegypt - any progress on this one? |
|
I can't really use computers at the moment due to an issue with my eye. So I can't really deal with this right now. I hope to be back to normal in a few weeks. In response to your comment @metajack the reason that the boolean is checked and updated on both incoming and outgoing threads is due to the current threading. I can write up a better explanation when I'm back but I'm just rushing this comment for now. If someone else wants to wrap this up feel free. |
|
components/net/websocket_loader.rs, line 129 [r3] (raw file): Comments from Reviewable |
|
The code and explanation makes sense to me. @bobthekingofegypt if you squash the commits, I'll merge it :) |
|
I'm not sure how I forgot to comment here. I could have sworn I wrote out an r=me. In any case, I apologize for the delay and I agree with jdm. |
Need to make sure close is only sent to the server once, either from a client initiation or from a server echo. This adds the sent check to both incoming and outgoing threads.
97c58fc
to
27b4ac6
highfive
commented
Jun 10, 2016
|
New code was committed to pull request. |
|
@bors-servo: r=metajack |
|
|
stop client websocket close echoing server close Client initiated close requests should send a close message to the server that the server will echo back to complete the process. Servo should not then echo the servers close request back again to the server, this guard stops servo from echoing a server close request if the process was initiated by the client. Tracked in #9803 (comment) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10382) <!-- Reviewable:end -->
|
|
bobthekingofegypt commentedApr 3, 2016
Client initiated close requests should send a close message to the
server that the server will echo back to complete the process. Servo
should not then echo the servers close request back again to the server,
this guard stops servo from echoing a server close request if the
process was initiated by the client.
Tracked in #9803 (comment)
This change is