-
Notifications
You must be signed in to change notification settings - Fork 51
Use two buffers instead of one buffer in split mode #18
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
Conversation
Do you have any comments on this PR? |
I've just looked at it (and tested it) and it seems like a reasonable addition. However I'm currently having memory constraints in Arduino's main application of this library (that is the Arduino IoT Cloud firmware) so I'd rather hold off merging this in for now. |
If you have memory constraints, I could tune the PR to update the default values of |
Good morning @ffontaine 👋 This sounds like an acceptable compromise, can you please update this PR accordingly? |
Sure, however I'm not a user of the Arduino IoT Cloud firmware so what default values will please you? 4k for each buffer? 8k for input and 4k for output or even 8k for each buffer (even if this one seems a bit oversized) |
So. I've investigated the current situation and found the following results. This is how the buffer is structured currently:
If your PR can preserve this structure then that would be great. |
Use two dedicated buffers for input and output instead of split mode. Indeed some MQTT server (especially with TLS) needs a full 8k buffer as they send their Certificate. On the other hand, on output, a smaller buffer is needed. Clients will be able to finely tune those values by defining BEAR_SSL_CLIENT_{I,O}BUF_SIZE before including ArduinoBearSSL.h, the default default values have been chosen to keep current behavior as requested during review. Signed-off-by: Fabrice Fontaine <[email protected]>
OK done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ffontaine 🚀
Use two dedicated buffers for input and output instead of split mode,
indeed some MQTT server (especially with TLS) needs a full 8k buffer as
they send their Certificate Chain. On the other hand, on output, a 1k
buffer seems to be enough
Signed-off-by: Fabrice Fontaine [email protected]