mirror of
https://github.com/games-on-whales/wolf.git
synced 2026-10-15 13:02:03 +00:00
[PR #432] [MERGED] fix(rtsp): keep RTSP server alive when a client disconnects mid-request #465
Labels
No labels
🧠 1 - 🤖 999
AMD
bug
bug
cannot reproduce
documentation
duplicate
easy
enhancement
enhancement
enhancement
fixed?
fixed?
good first issue
hard
help wanted
Intel
invalid
LXC
medium
moonlight-protocol
Multi GPU
nixos
not a bug
nvidia
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/wolf#465
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/wolf/pull/432
Author: @JBailes
Created: 6/14/2026
Status: ✅ Merged
Merged: 6/14/2026
Merged by: @ABeltramo
Base:
stable← Head:fix/rtsp-server-crash-on-client-reset📝 Commits (1)
7351162fix(rtsp): keep RTSP server alive when a client disconnects mid-request📊 Changes
1 file changed (+49 additions, -11 deletions)
View changed files
📝
src/moonlight-server/rtsp/net.hpp(+49 -11)📄 Description
Problem
A client that opens an RTSP connection, sends a malformed/partial request, and immediately resets the connection (Moonlight does exactly this on a rejected message) leaves the socket disconnected. Wolf then performed socket operations on the dead socket that throw
boost::system::system_error(ENOTCONN, "Transport endpoint is not connected"):tcp_connection::close()used the throwingshutdown()/close()overloads;start()calledsocket().remote_endpoint()on the now-disconnected socket.These run inside
io_context.run(), so the exception unwinds all the way out ofrun_server(), which logs:and returns — the entire RTSP server dies. Every subsequent connection gets
ECONNREFUSED, so no stream can be set up (clients report being unable to start the RTSP handshake). A single early-disconnecting client takes down streaming for everyone until Wolf restarts.Reproduced with a packet capture: client sends a 1-byte message then RSTs → Wolf sends
400 BAD REQUEST→close()→shutdown()throws → server gone.Fix
close()— use the non-throwingerror_codeoverloads ofshutdown()/close().start()— resolveremote_endpoint()non-throwing and bail cleanly if the peer is already gone (also avoids a redundant secondremote_endpoint()call).handle_accept()— re-arm the acceptor before servicing the connection and wrapstart()in try/catch, so one bad connection can never stop the accept loop.run_server()— resumeio_context.run()after a handler exception instead of letting it tear the server down (defense in depth).Testing
Verified on a live deployment: before the fix, a single
\n+RST probe to :48010 killed the server (subsequent connects refused); after, the server survives repeated reset-probes and keeps serving, and Moonlight streaming (Wolf UI + Steam) works.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.