-
Notifications
You must be signed in to change notification settings - Fork 8k
esp_https_ota_begin(): handle HttpStatus_PartialContent-code 206 (IDFGH-16894) #17960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
esp_https_ota_begin(): handle HttpStatus_PartialContent-code 206 (IDFGH-16894) #17960
Conversation
👋 Hello rubienr, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
3f51ed8 to
70f29c0
Compare
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD | |||
| / * SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Accidental character introduced in copyright comment line
The block comment continuation on line 2 was changed from * SPDX-FileCopyrightText... to / * SPDX-FileCopyrightText.... A / character was accidentally inserted where a space should be, breaking the conventional block comment formatting style. While this doesn't affect compilation (it's still valid inside the /* */ block), it appears to be an unintended keystroke that should be reverted.
70f29c0 to
4e41e8c
Compare
4e41e8c to
cac95eb
Compare
|
sha=cac95eb984fbea21ba3defaf1411ecb10bf646ca |

Description
Summary
This PR implements
206 Partial Contentinesp_https_ota_begin().Issue
Currently the esp-idf implementation ignores whether the server supports or doesn't support range requests. If OTA is resumed and the server responds
200 OKinstead of206 Partial Content, the OTA will download the image starting at byte 0 but resume writing in flash (after last index when it aborted).How to reproduce:
python -m http.server 8000; at the time of writinghttp.serverwith Python3.13does not support range requests (lets call this serverA)sudo ss --kill --option state established "sport = :8000"Testing
Simple resumption scenario
python -m flask --app server run --port 8000 --host 0.0.0.0;server.pyscript not provided here (lets call this serverB))sudo ss --kill --option state established "sport = :8000"Hypothetic resumption scenario
AAand start serverBChecklist
Before submitting a Pull Request, please ensure the following:
Note
When resuming OTA with a Range request, return
ESP_ERR_HTTP_RANGE_NOT_SATISFIABLEif the server doesn’t respond with206 Partial Content._http_handle_response_code(components/esp_https_ota/src/esp_https_ota.c), when resuming (binary_file_len > 0)HttpStatus_PartialContent (206), log "Requested range header ignored by server" and returnESP_ERR_HTTP_RANGE_NOT_SATISFIABLEto abort OTA.Written by Cursor Bugbot for commit cac95eb. This will update automatically on new commits. Configure here.