fix(nest): fix stream expiry, token refresh, timeouts, and resource leaks#2194
Open
MechanicalCoderX wants to merge 1 commit intoAlexxIT:masterfrom
Open
fix(nest): fix stream expiry, token refresh, timeouts, and resource leaks#2194MechanicalCoderX wants to merge 1 commit intoAlexxIT:masterfrom
MechanicalCoderX wants to merge 1 commit intoAlexxIT:masterfrom
Conversation
…eaks - ExtendStream: replace one-shot *time.Timer with an extendMu/extendStop channel loop so streams are extended reliably every ~55 seconds instead of expiring after the first extension fires and is not rescheduled - refreshToken: store ClientID, ClientSecret, RefreshToken on the API struct so refreshToken() can re-authenticate directly; the previous cache-key lookup failed after the first token rotation because the cached entry had already been replaced with the new token - NewAPI/GetDevices/ExchangeSDP: fix HTTP client timeout of 5000 seconds (5000 * time.Second) to a sane 10 * time.Second - rtcConn: call pc.Close() on all three error paths (CreateCompleteOffer, ExchangeSDP, SetAnswer) to prevent WebRTC peer connection leaks - client.go/api.go: fix typos cliendID → clientID, cliendSecret → clientSecret throughout; fix "backwards compataiility" comment typo
gavinscheele
added a commit
to gavinscheele/go2rtc
that referenced
this pull request
Apr 14, 2026
…eaks Cherry-picked from AlexxIT/go2rtc PR AlexxIT#2194. - Replace one-shot extend timer with a loop that reschedules after each successful extension — stream stays alive indefinitely - Store OAuth credentials on API struct so refreshToken() works after the first token rotation (cache key lookup broke after rotation) - Fix HTTP timeout from 5000s (typo) to 10s - Add retry logic on ExtendStream: 401 → refresh token, 409/429 → backoff - Close WebRTC peer connections on all error paths (prevent resource leaks) - Fix typos: cliendID → clientID, compataiility → compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ExtendStream: replace one-shot*time.Timerwith anextendStopchannel loop so streams are extended reliably every ~55 seconds instead of expiring after the first extension fires and is not rescheduledrefreshToken: storeClientID/ClientSecret/RefreshTokenon theAPIstruct sorefreshToken()can re-authenticate directly; the previous cache-key lookup failed after the first token rotation because the cached entry had already been replacedNewAPI/GetDevices/ExchangeSDP: fix HTTP client timeout of5000 * time.Secondto10 * time.SecondrtcConn: callpc.Close()on all three error paths (CreateCompleteOffer, ExchangeSDP, SetAnswer) to prevent WebRTC peer connection leaksFix typos
cliendID→clientID,cliendSecret→clientSecret,compataiility→compatibility