Skip to content

Commit 4e41e8c

Browse files
author
Raoul Rubien
committed
fix esp_https_ota_begin(): implements handling of HttpStatus_PartialContent-code 206
1 parent 683ddf8 commit 4e41e8c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/esp_https_ota/src/esp_https_ota.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ static esp_err_t _http_handle_response_code(esp_https_ota_t *https_ota_handle, i
135135
} else if (status_code >= HttpStatus_InternalError) {
136136
ESP_LOGE(TAG, "Server error (%d)", status_code);
137137
return ESP_FAIL;
138+
} else if (https_ota_handle->binary_file_len > 0
139+
#if CONFIG_ESP_HTTPS_OTA_ENABLE_PARTIAL_DOWNLOAD
140+
&& !https_ota_handle->partial_http_download
141+
#endif
142+
&& status_code != HttpStatus_PartialContent) {
143+
ESP_LOGE(TAG, "Requested range header ignored by server");
144+
return ESP_ERR_HTTP_RANGE_NOT_SATISFIABLE;
138145
}
139146

140147
char upgrade_data_buf[256];

0 commit comments

Comments
 (0)