You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug with a clear and concise description of what the bug is.
Just gonna copy kim's comments from Matrix in here:
i just took a look, and it basically does net/http hijack on the incoming UPGRADE request connection
soooo, there might actually be an easy way of handling this
we're currently holding open the main request handler with the streaming loop
but if the net/http hijack logic allows us to return that handler and perform the stream loop in another goroutine, that would mean throttling won't be an issue with websockets :)
in fact if that is the case, then that would be advantageous as it still allows us to throttle the streaming UPGRADE endpoint instead of completely ignoring it
by the looks of things it should be fine to return from the upgrade handler: https://pkg.go.dev/net/http#Hijacker
basiccally all we should need to do is
1234567891011gofunc() {
// create new websocket context as the original net/http// request context is only valid until the calling handler returns.ctx, cncl:=context.WithCancel(context.Background())
defercncl()
for {
// do some shit with wsConn, yada yada ...
}
}()
and the logic from here onwards can go in that goroutine:
Describe the bug with a clear and concise description of what the bug is.
Just gonna copy kim's comments from Matrix in here:
What's your GoToSocial Version?
git
GoToSocial Arch
No response
Browser version
No response
What happened?
No response
What you expected to happen?
No response
How to reproduce it?
No response
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: