ESP8266 Webserver Project

Moderator: Sprite_tm

User avatar
By kriegste
#21292 I changed it to this:

Code: Select allvoid ICACHE_FLASH_ATTR jsonHeader(HttpdConnData *connData, int code) {
   httpdStartResponse(connData, code);
   httpdHeader(connData, "Cache-Control", "no-cache, no-store, must-revalidate");
   httpdHeader(connData, "Pragma", "no-cache");
   httpdHeader(connData, "Expires", "0");
   httpdHeader(connData, "Content-Type", "application/json");
   httpdEndHeaders(connData);
}


It seems to work. But...

while hitting F5 endlessly I noticed there must be a memory leak somewhere..... First I disabled heatshrink. When I reload a large file AFTER it was transferred, the heap restores to its original size (after some seconds). When I reload a large file WHILE it is already loading, the heap loses exactly 40 bytes, every time. Those will not restore. I tried and took this number with but one file yet.
User avatar
By Sprite_tm
#21312 Do you use a recent version of esphttpd in your software? If not, you may want to browse through its commit log: I know I have solved a memory leak that sounds suspiciously like this one somewhere. In general, now might be a good idea to switch to a newer version of esp-httpd: I recently modularized it, making it way easier to upgrade while used in a project.