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

Add optional reason message and code to WebSocket.close #1107

Merged
merged 2 commits into from
May 16, 2015

Conversation

Yoplitein
Copy link
Contributor

Not sure why the payload length is limited to 125 bytes. Regular messages can be longer, so it doesn't seem to be an issue with vibe code. I found no mention of such a limit for close frames in the RFC.

@s-ludwig
Copy link
Member

According to the RFC, the status code should match the codes in section 7.4. For that reason and to avoid a dynamic memory allocation in the default case, I'd wrap the new code in an if (code != 0). I'd also change the order of parameters, because the code must always be set properly if a message is given, but not vice-versa. Otherwise looks good.

@s-ludwig
Copy link
Member

The 125 byte limit is mentioned in Section 5.5:

All control frames MUST have a payload length of 125 bytes or less
and MUST NOT be fragmented.

@Yoplitein
Copy link
Contributor Author

The 125 byte limit is mentioned in Section 5.5:

Ah. I guess I didn't look well enough.

I'd wrap the new code in an if (code != 0). I'd also change the order of parameters

Done and done. Also rebased, so the builds should pass now.

@s-ludwig
Copy link
Member

Thanks!

s-ludwig added a commit that referenced this pull request May 16, 2015
Add optional reason message and code to WebSocket.close
@s-ludwig s-ludwig merged commit 058c45d into vibe-d:master May 16, 2015
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.

2 participants