Skip to content
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

_http.getStream() replace with getString. #162

Open
JurePotocnik opened this issue Feb 23, 2025 · 0 comments
Open

_http.getStream() replace with getString. #162

JurePotocnik opened this issue Feb 23, 2025 · 0 comments

Comments

@JurePotocnik
Copy link

I do not know it's just me or we could make same change.
When downloading the versions.json file we connect to server, open stream and deserializeJson with stream as input. In my case, the stream is always null, so i change it to getString, which actually returns the json content and then convert to json.

File: esp32FOTA.cpp:849

Current code:
// TODO: use payload.length() to speculate on JSONResult buffer size #define JSON_FW_BUFF_SIZE 2048 DynamicJsonDocument JSONResult( JSON_FW_BUFF_SIZE ); DeserializationError err = deserializeJson( JSONResult, _http.getStream() );

Changed code:
// TODO: use payload.length() to speculate on JSONResult buffer size #define JSON_FW_BUFF_SIZE 2048 DynamicJsonDocument JSONResult( JSON_FW_BUFF_SIZE ); String jsonString = _http.getString(); DeserializationError err = deserializeJson( JSONResult, jsonString );

I know that in this case, I am using some additional memory for the String but in that case it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant