khoih-prog / EthernetWebServer

This is simple yet complete WebServer library for AVR, AVR Dx, Portenta_H7, Teensy, SAM DUE, SAMD21/SAMD51, nRF52, STM32, RP2040-based, etc. boards running Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Coexisting now with `ESP32 WebServer` and `ESP8266 ESP8266WebServer` libraries. Ethernet_Generic library is used as default for W5x00 with custom SPI
MIT License
178 stars 49 forks source link

Added implementation of streamFile and serveStatic #21

Closed AC8L closed 3 years ago

AC8L commented 3 years ago

Ported functions from ESP8266WebServer and wrote custom client wrote file with bufferization.

khoih-prog commented 3 years ago

Thanks for your PR.

Just have a very quick look at the PR: the modified code, intentionally left out, will serve only ESP8266/ESP32, and will break the support for other boards, which is the main target of this library.

Could you modify the code, by adding the #if (ESP8266 || ESP32) to ESP-specific code, so that it's still OK with the other boards.

Another preferable option is to create a new class, derived from class EthernetWebServer, e.g. ESP_EthernetWebServer for ESP boards, then modify it for only ESP32/ESP8266.

So I won't merge the unchanged PR now and am waiting for your mods.

BR

AC8L commented 3 years ago

Created fresh branch with proposed changes and created new PR, closing this.