Skip to content

Conversation

@s-hadinger
Copy link
Contributor

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

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

I replaced with 2 arrays for suffix and mime-type, with 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 a little over 1kB for Tasmota.

* moving to 2 arrays for suffix and mime-type, with PROGMEM strings
* adding `#define MIMETYPE_MINIMAL` to reduce the footprint to
  mime-types that are strictly necessary
@d-a-v
Copy link
Collaborator

d-a-v commented May 18, 2020

Nice but it's an API breaking change.

@s-hadinger
Copy link
Contributor Author

Oh, if mimeTable[] is part of the API, I can put it back in a single array which would be API-compatible. Let me do the change.

@s-hadinger
Copy link
Contributor Author

Closed in favor of #7312

@s-hadinger s-hadinger closed this May 18, 2020
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

Successfully merging this pull request may close these issues.

2 participants