std.Build.WebServer: fix race
Just a typo: I wasn't actually using the duped message, so the message I sent could be freed in this interval.
This commit is contained in:
committed by
Alex Rønne Petersen
parent
e323dbfd15
commit
a4cb636658
@@ -323,7 +323,7 @@ fn serveWebSocket(ws: *WebServer, sock: *http.Server.WebSocket) !noreturn {
|
|||||||
// Temporarily unlock, then re-lock after the message is sent.
|
// Temporarily unlock, then re-lock after the message is sent.
|
||||||
ws.time_report_mutex.unlock();
|
ws.time_report_mutex.unlock();
|
||||||
defer ws.time_report_mutex.lock();
|
defer ws.time_report_mutex.lock();
|
||||||
try sock.writeMessage(msg, .binary);
|
try sock.writeMessage(owned_msg, .binary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user