From: Ian Jackson Date: Sun, 11 Jul 2021 22:47:25 +0000 (+0100) Subject: sse: Return from read() impl immediately after cv return X-Git-Tag: otter-1.0.0~137 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=8b0c09c73afc93ccce916183f01b90d892311602;p=otter.git sse: Return from read() impl immediately after cv return This is going to make it easier to work with a condvar wait which disposes of the mutex guard. Signed-off-by: Ian Jackson --- diff --git a/daemon/sse.rs b/daemon/sse.rs index 4e1dc387..31dceaf9 100644 --- a/daemon/sse.rs +++ b/daemon/sse.rs @@ -210,6 +210,8 @@ impl Read for UpdateReader { data: online {} {} G{}\n\n", self.player, self.client, ig.gs.gen)?; self.keepalives += Wrapping(1); + self.need_flush = true; + return Ok(buf.generated()); /* write!(buf,": keepalive\n\n")?; */ }