Repository navigation
Backport OpenNOW-Switch #49 signaling and allocation hardening - #30
ducktailgoat wants to merge 2 commits into
Conversation
Since 2026-10-27 CloudMatch picks the streamer from the client identity. NATIVE / NVIDIA-CLASSIC sessions only get classic RTSP endpoints, so the WebRTC signaling socket connects but no SDP offer ever arrives and the stream stays on "Connecting stream". CloudMatch /v2/ requests (session create, poll, stop, server info and network test) now send BROWSER / WEBRTC, client version 2.0.89.154, nv-browser-type CHROME and a plain Chrome user agent, without the GFN-PC x-nv-client-identity. Session and network test bodies use clientPlatformName "browser". Catalog requests keep the native identity. Ported from OpenNOW-Switch #48 (issue #47).
Ports the parts of OpenNOW-Switch #49 that PS5 did not already have, limited to changes that only affect responses PS5 fails on today, so the console-verified launch path is unchanged. Signaling: - Losing the signaling socket after the answer no longer ends a running stream. The socket is closed and dropped, the loss is logged to media.log, and the existing WebRTC state and video watchdogs still end a stream whose media stops. Losses before the answer still fail. CloudMatch allocation: - Accept usage and port values sent as strings. - Use the connection port for appLevelProtocol 4 signaling entries. - Bracket bare IPv6 hosts in derived signaling URLs. - Rewrite an explicit https:// signalingUrl to wss:// and validate explicit and resourcePath URLs (no userinfo, fragments or bad ports). - Skip placeholder hosts such as ".cloudmatchbeta.nvidiagrid.net", 0.0.0.0 and :: instead of dialing them. - Fail with the session retained after 12 ready polls without a usable streaming address instead of polling forever. - Keep waiting when an APP_PATCHING_STATUS poll omits the session. Not ported: queue-ad reporting, retrying signaling before the first offer, and the connection preference changes (preferring WebRTC over RTSP entries, never using RTSP ports as media hints, dropping the serverIp/sessionControlInfo signaling fallbacks), which change endpoint selection for responses that work today.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Tip 🎯 Customize your risk assessments
✅ Automatic approvals, with your rules
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Stacked on #28 (its first commit is the first one here); review the last commit only.
Summary
Backports the parts of OpenCloudGaming/OpenNOW-Switch#49 that PS5 did not already have, limited to changes that only affect responses PS5 fails on today. Most of the Switch PR's WebSocket work (binary and fragmented frames, close codes, rejected-upgrade status, query escaping, offer timeout) was already present.
Signaling, in
Stream::tick:CloudMatch allocation, in
cloud.cpp:Not ported, to keep the working launch path unchanged: preferring WebRTC over RTSP connection entries, never using RTSP ports as media hints, dropping the
serverIp/sessionControlInfosignaling fallbacks (current PS5 tests assert these), retrying signaling before the first offer, and queue-ad reporting.Evidence
tests/stream_lifecycle_test.cpp): start, receive offer, answer sent, then drop the socket.Before:
stream.failed()and the stream is released.After: stream stays active, the socket is freed (
sockets==0,peers==1), the loss is logged, later heartbeat ticks do nothing. Pre-answer socket loss still fails as before.tests/cloud_test.cpp): six newNetworkCasefixtures (string numbers, protocol-4 port, IPv6, https signalingUrl, placeholder hosts, malformed explicit URL), a 12-poll bounded ready wait, and a patching poll withoutsession.Before: the first new fixture never becomes ready (
"usage":"14").After: all pass, together with the existing fixtures.
tools/test-port.shgives identical results on this branch and on its base.OFFER/ANSWER, 2560x1440 for 60 to 68 s, 7824 frames decoded, 0 decode errors. Signaling was never lost during these runs, so the post-answer loss path is still covered only by the host test.Merge Danger
Door: two-way. No persisted data or format changes.
Blast Radius: stream lifetime and session allocation.
A stream now survives signaling loss after the answer. If NVIDIA uses a post-answer close to end sessions, the stream would end through the media watchdogs instead of immediately: on WebRTC failure, or about 12 s after video stops decoding (keyframe request at 8 s, failure 4 s later). Stricter URL and host validation could reject an address the old code accepted; the existing fixtures, including the shape of the console-verified launch (
route=stream), still pass.