fix(esp_http_client): Revert Deprecated Tag on Previously Marked Private API

This commit removes depcriacted tag marked on priavte APIs'
http_utils_get_string_between() and http_utils_get_string_after().
As these are not publick API, necessary changes been applied on these
APIs' directly withput adding new similar one and marking them as depricated.
This commit is contained in:
nilesh.kale
2025-01-16 17:20:27 +05:30
parent 9c421495cc
commit f638090179
3 changed files with 11 additions and 68 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -110,41 +110,7 @@ void http_utils_trim_whitespace(char **str)
memmove(*str, start, strlen(start) + 1);
}
char *http_utils_get_string_between(const char *str, const char *begin, const char *end)
{
char *found = strcasestr(str, begin);
char *ret = NULL;
if (found) {
found += strlen(begin);
char *found_end = strcasestr(found, end);
if (found_end) {
ret = calloc(1, found_end - found + 1);
mem_check(ret);
memcpy(ret, found, found_end - found);
return ret;
}
}
return NULL;
}
char *http_utils_get_string_after(const char *str, const char *begin)
{
char *found = strcasestr(str, begin);
char *ret = NULL;
if (found) {
found += strlen(begin);
char *found_end = (char *)str + strlen(str);
if (found_end) {
ret = calloc(1, found_end - found + 1);
mem_check(ret);
memcpy(ret, found, found_end - found);
return ret;
}
}
return NULL;
}
esp_err_t http_utils_get_substring_between(const char *str, const char *begin, const char *end, char **out)
esp_err_t http_utils_get_string_between(const char *str, const char *begin, const char *end, char **out)
{
*out = NULL;
char *found = strcasestr(str, begin);
@@ -160,7 +126,7 @@ esp_err_t http_utils_get_substring_between(const char *str, const char *begin, c
return ESP_OK;
}
esp_err_t http_utils_get_substring_after(const char *str, const char *begin, char **out)
esp_err_t http_utils_get_string_after(const char *str, const char *begin, char **out)
{
*out = NULL;
char *found = strcasestr(str, begin);