Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By Pat Deegan
#35929 Greetings!

I've been building some interesting stuff with the ESP8266 and its Arduino SDK (many thanks to all contributors). I'd created a few extensions of my own to the ESP8266WebServer class, in version 1.6.5, and now find I need to re-do the work for the v2 mods.

Thus, this is a good time to propose the changes for general consumption, and to ask about if and how you'd like these mods delivered.

In short, I made the following changes:

  1. a sendRaw(uint8_t * buf, size_t len) method to do just that: send raw data down an open connection, without any headers or extra fluff. I've used this to send binary data/images and to create a simple templating system that can take static and dynamic parts and merge them into a single output (graphic or HTML or whatever);
  2. a close() method to close an open connection, which avoids having browsers looking like they're still waiting on content pending the timeout;
  3. an extension to the supported callbacks for the on() methods, that allows you to get the requested URI as a parameter to your callback. I've used this for an access control system.

Looking over the code now, I feel the last item may be redundant but it avoids needing access to the webserver object to do the work (can be a simple lamba function with no captures).

If any or all of these are of interest to the larger community, I'd like to know if there are any resources/descriptions on the specifics of contributing code. Do you want simple pull requests? Do you want the pulls separated by function? Do need branches for each mod? etc...

Thanks again for these awesome and useful bits of code, hopefully I can make my own contributions as well.

Regards,
Pat Deegan