Added optional size template argument for `SSLClient` constructor
Description
I didn't want to hardcoded change the unsigned char m_iobuf[2048]; in the SSLCLient.h every time I reimport the library.
Therefore I added an optional template argument for SSLClientSized that decides the buffer size. There is also still a default SSLClient that works with the default value defined in DefaultBufferSize, which is still the 2048 like previously.
Meaning the change is backwards compatible and has the same behaviour simply change the #define DefaultBufferSize or pass a template argument in the SSLClientSized class.
Additionally because of these changes I had to move the enums out of the class into their own .h files, because If I wouldn't have you always would have to access the enums with SSLClientSized<DefaultBufferSize>::Error::SSL_OK;.
I also had to move all methods into the .h file, because the methods can't be defined in the .cpp with a template class.
Simplifies #46
Type of change
Please uncheck options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [X] This change requires a documentation update
- [X] I have made the appropriate changes to documentation already
How Has This Been Tested?
- [X] Sending data via. MQTT over the SSLClient with an ESP32 (Running for multiple hours)
Test Configuration:
- Device type: ESP32, M5 Core 1
- SSLClient version: 1.6.11
- Arduino core version: 2.0.1
Still no answer, adding a comment in hope somebody will merge the pull request. I've used it for a few month now and it still works perfectly.
@prototypicalpro Would be nice if this could be merged.
Hello! I appreciate the effort (seriously), however moving to header-only is not a direction I would like to take this library at this time.
While this library is available to anyone to use, it is ultimately beholden to the Open Sensing Lab (where I worked when I wrote this originally). Unfortunately if I were to change this library to header only I would nearly double incremental compile times using the Arduino IDE (more on that here). When I worked there many years ago the long compile time was the most common complaint about the library, and as a result header-only was considered but discarded in favor of static configuration. I no longer work at the Open Sensing Lab, but as I understand it this library is still in use there--as a result any changes I make must keep the compile time constraint into account.
I do want people to use your changes, however--now that I work full time I hardly have time to maintain this library anyway--so what I can do is enable discussions on this repository and you can post your fork in a place where people can find it.