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

Remove condition "If channel's underlying data transport is not established yet, then abort these steps" from send() #1398

Closed
wants to merge 1 commit into from

Conversation

soareschen
Copy link
Contributor

Fixes #1396.

@aboba
Copy link
Contributor

aboba commented Jun 19, 2017

@soareschen Since Step 2 throws when readyState != "open", why does step 4 still need to check whether the closing procedure has been started?

@nils-ohlmeier
Copy link

I think @aboba is right here. Since the first thing close() does is to change the readyState I think it is safe to remove the whole step 4 as by PR #1404 .

@soareschen
Copy link
Contributor Author

soareschen commented Jun 20, 2017

My thinking was that the closing procedure does not necessarily get invoked by closed, e.g. when closed by remote peer. In that case the changing from open to closing is queued as a task and could result in race condition.

But you are right that the whole step can be removed entirely. Because even if we guard against that, the remote peer can still close while data being sent and result in data loss. It is simpler to just queue it to the buffer regardless and let the closing procedure handle discarding the queue.

Closing this in favor of #1404.

@soareschen soareschen closed this Jun 20, 2017
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