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

Flash size reduction for mime-type #7312

Merged
merged 3 commits into from
May 19, 2020

Conversation

s-hadinger
Copy link
Contributor

Superseded #7311

The current mime-type array is based on Entry structure with fixed size string that waste a lot of Flash space (~400 bytes):

struct Entry
{
  const char endsWith[16]; 
  const char mimeType[32];
};

I replaced with standard PROGMEM strings.

I also added #define MIMETYPE_MINIMAL to reduce the footprint to mime-types that are strictly necessary: html, txt, gz

Overall this saves 1kB for Tasmota.

* moving from fixed size strings to standard PROGMEM strings
* adding `#define MIMETYPE_MINIMAL` to reduce the footprint to
  mime-types that are strictly necessary
Copy link
Collaborator

@devyte devyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was something pending, thanks.

libraries/ESP8266WebServer/src/detail/mimetable.cpp Outdated Show resolved Hide resolved
libraries/ESP8266WebServer/src/detail/mimetable.cpp Outdated Show resolved Hide resolved
@earlephilhower
Copy link
Collaborator

One of the VMs died during the CI process. Just restarted, once it's good I'll hit merge.

@earlephilhower earlephilhower merged commit 7c008e3 into esp8266:master May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants