mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWebSocket: Add enum definition for status 1005 "no status received"
Just for a little less use of magic numbers.
This commit is contained in:
committed by
Shannon Booth
parent
fce09498f6
commit
a1a9ff6bf5
Notes:
github-actions[bot]
2026-03-13 16:29:29 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/a1a9ff6bf57 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8340 Reviewed-by: https://github.com/gmta
@@ -28,6 +28,7 @@ enum class CloseStatusCode : u16 {
|
||||
GoingAway = 1001,
|
||||
ProtocolError = 1002,
|
||||
UnsupportedData = 1003,
|
||||
NoStatusReceived = 1005,
|
||||
AbnormalClosure = 1006,
|
||||
InvalidPayload = 1007,
|
||||
PolicyViolation = 1008,
|
||||
@@ -55,7 +56,7 @@ public:
|
||||
void send(Message const&);
|
||||
|
||||
// This can only be used if the `ready_state` is `ReadyState::Open`
|
||||
void close(u16 code = 1005, ByteString const& reason = {});
|
||||
void close(u16 code = to_underlying(CloseStatusCode::NoStatusReceived), ByteString const& reason = {});
|
||||
|
||||
Function<void()> on_open;
|
||||
Function<void(u16 code, ByteString reason, bool was_clean)> on_close;
|
||||
@@ -127,7 +128,7 @@ private:
|
||||
|
||||
bool m_discard_connection_requested { false };
|
||||
|
||||
u16 m_last_close_code { 1005 };
|
||||
u16 m_last_close_code { to_underlying(CloseStatusCode::NoStatusReceived) };
|
||||
ByteString m_last_close_message;
|
||||
|
||||
ConnectionInfo m_connection;
|
||||
|
||||
Reference in New Issue
Block a user