dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 6432ea4392a3cd354669b3a06242941224d8f892
parent 9c1883e95958e93ddc0cb45c7d502f22b2165ef6
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Mon, 29 May 2023 02:39:43 -0700

doc

Diffstat:
Mpkg/web/handlers/handlers.go | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -5045,6 +5045,7 @@ func ChatStreamMessagesHandler(c echo.Context) error { quit := closeSignalChan(c) + // Keep track of users streams, so we can limit how many are open at one time per user if err := usersStreamsManager.Add(authUser.ID); err != nil { return nil } @@ -5055,6 +5056,7 @@ func ChatStreamMessagesHandler(c echo.Context) error { c.Response().Header().Set("Transfer-Encoding", "chunked") c.Response().Header().Set("Connection", "keep-alive") + // Keep track of how many bytes we sent on the http request, so we can auto-refresh when passing a threshold bytesSent := 0 send := func(s string) { n, _ := c.Response().Write([]byte(s))