Closed john-hollander closed 9 months ago
Note: These changes should fix the following issues:
Fixed in 8.0.1. Thanks for reporting and PR!
No problem. Thanks for updating and cleaning everything up. I missed the
bool storeStatus = ((opcode & WS_CLOSE) == WS_CLOSE) && ((buffer.Length > 0) || (status != 0));
update, and I think it caused me a few issues. Your changes should resolve those, thanks!
In our testing, the status code was not being sent with no message, as the close(status) method suggested it would. When we tested with the SendCloseAsync methods and included a message, the status was not being set properly, and there was an "index out of bounds" error that caused the connection to not close. These fixes address the problems, and additionally, more close methods have been added so that the message can be more easily included on closures.
Note: we could have put the mask frame content loop outside of the if statement and shared it for both cases by using buffer[i - index] instead, but figured that this way would be slightly faster without the extra operation for regular (non-close) message frames.