Re: esp-link - serial bridge to uController with OTA update
Posted:
Mon Jun 22, 2015 5:19 pm
by tve
Good point, I have not looked at the cache header stuff.
https://github.com/jeelabs/esp-link/issues/23
Re: esp-link - serial bridge to uController with OTA update
Posted:
Mon Jun 22, 2015 5:34 pm
by kriegste
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.
Re: esp-link - serial bridge to uController with OTA update
Posted:
Mon Jun 22, 2015 9:49 pm
by tve
Can you describe how you tell the memory leak? What are you transferring and what do you do? I want to make sure I can repro so I can track it down...
Re: esp-link - serial bridge to uController with OTA update
Posted:
Mon Jun 22, 2015 10:35 pm
by Sprite_tm
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.