Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-26 05:50:29 +01:00
Prevent generating an error during ws close (#4127)
When a WebSocket connection was closing it was sending a message after it was closed already. This generated an error in the logs. While this error didn't harm any of the functionallity of Vaultwarden it isn't nice to see them of course. This PR Fixes this by catching the close message and breaks the loop at that point. This prevents the `_` catch-all from replying the close message back to the client, which was causing the error message. Fixes #4090
Dieser Commit ist enthalten in:
Ursprung
48836501bf
Commit
0fdda3bc2f
1 geänderte Dateien mit 10 neuen und 0 gelöschten Zeilen
|
@ -164,6 +164,11 @@ fn websockets_hub<'r>(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prevent sending anything back when a `Close` Message is received.
|
||||||
|
// Just break the loop
|
||||||
|
Message::Close(_) => break,
|
||||||
|
|
||||||
// Just echo anything else the client sends
|
// Just echo anything else the client sends
|
||||||
_ => yield message,
|
_ => yield message,
|
||||||
}
|
}
|
||||||
|
@ -230,6 +235,11 @@ fn anonymous_websockets_hub<'r>(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prevent sending anything back when a `Close` Message is received.
|
||||||
|
// Just break the loop
|
||||||
|
Message::Close(_) => break,
|
||||||
|
|
||||||
// Just echo anything else the client sends
|
// Just echo anything else the client sends
|
||||||
_ => yield message,
|
_ => yield message,
|
||||||
}
|
}
|
||||||
|
|
Laden …
In neuem Issue referenzieren