UpdateManager: release download mutex when HTTP client setup fails - #21
Open
jamesmulcahy wants to merge 1 commit into
Open
jamesmulcahy wants to merge 1 commit into
jamesmulcahy wants to merge 1 commit into
Conversation
_download_data took _download_data_store_mutex but only released it when _setup_http_client succeeded. A setup failure left the mutex held, so all later checksum fetches and downloads blocked forever. Also fail early if esp_http_client_init returns NULL instead of using a NULL handle. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X7aYyRjzk53Sd7gxF46E3u
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.
Summary
_download_datatakes_download_data_store_mutexwithportMAX_DELAY, but only gives it back inside the branch where_setup_http_clientsucceeded. If setup fails (e.g. setting theRangeheader fails), the function returns with the mutex still held, and every later checksum fetch or download blocks forever.This PR:
_download_data_store) when_setup_http_clientfails._setup_http_clientreturn an error ifesp_http_client_initreturnsNULL, instead of passing aNULLhandle on toset_header/perform.🤖 Generated with Claude Code
https://claude.ai/code/session_01X7aYyRjzk53Sd7gxF46E3u