mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpinet] Revert WebSocket: When Close() is called, call closed immediately (#5084)
This caused crashes in ntcore.
This reverts commit b879a6f8c6 (#5047).
This commit is contained in:
@@ -126,7 +126,6 @@ void WebSocket::Close(uint16_t code, std::string_view reason) {
|
||||
SendClose(code, reason);
|
||||
if (m_state != FAILED && m_state != CLOSED) {
|
||||
m_state = CLOSING;
|
||||
closed(code, reason);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,11 +337,8 @@ void WebSocket::SetClosed(uint16_t code, std::string_view reason, bool failed) {
|
||||
if (m_state == FAILED || m_state == CLOSED) {
|
||||
return;
|
||||
}
|
||||
bool wasClosing = m_state == CLOSING;
|
||||
m_state = failed ? FAILED : CLOSED;
|
||||
if (!wasClosing) {
|
||||
closed(code, reason);
|
||||
}
|
||||
closed(code, reason);
|
||||
}
|
||||
|
||||
void WebSocket::Shutdown() {
|
||||
|
||||
Reference in New Issue
Block a user