mirror of
https://github.com/coder/code-server.git
synced 2025-07-31 22:13:52 +08:00
Fix server crashing when sending data on closing/closed socket
This commit is contained in:
@ -117,11 +117,9 @@ export class Entry extends Command {
|
||||
app.wss.on("connection", (ws, req) => {
|
||||
const id = clientId++;
|
||||
|
||||
ws.on("open", () => {
|
||||
if (sharedProcess.state === SharedProcessState.Ready) {
|
||||
sendSharedProcessReady(ws);
|
||||
}
|
||||
});
|
||||
if (sharedProcess.state === SharedProcessState.Ready) {
|
||||
sendSharedProcessReady(ws);
|
||||
}
|
||||
|
||||
logger.info(`WebSocket opened \u001B[0m${req.url}`, field("client", id), field("ip", req.socket.remoteAddress));
|
||||
|
||||
|
Reference in New Issue
Block a user