chrisjoyce911 / esp32FOTA

Experiments in firmware OTA updates for ESP32 dev boards
The Unlicense
363 stars 89 forks source link

feat: Added setting for http reuse (keep-alive) #154

Closed sschueller closed 3 months ago

sschueller commented 3 months ago

This PR adds a configuration option to set the "http reuse" aka keep-alive.

cfg.allow_reuse = false;  // disables keep alive and kills connection when done

Some time after framework-arduinoespressif32 @ 3.20003.220626 (2.0.3) the heap usage drastically increased for https calls. If one has a project that makes https calls as well as the esp32FOTA library the heap can get to a point where one runs out of memory.

Since OTAs are generally not something that gets done a lot it should not consume too much of the heap especially if there is no update.

This option reduces the used heap by around 40k after OTA check call is done.

I wasn't sure if I should add this as a function or in the configuration. Please let me know if you would like any changes done.

tobozo commented 3 months ago

that makes a lot of sense, thanks!