drogue-iot / embedded-tls

An Rust TLS 1.3 implementation for embedded devices.
Apache License 2.0
168 stars 21 forks source link

Introduce a write buffer and use it to encode records #98

Closed bugadani closed 1 year ago

bugadani commented 1 year ago

Closes #91 Closes #92

In theory, we could encode multiple records in the same buffer without flushing but flushing means we don't have to deal with the insufficient buffer case where we would need to flush anyway.

The PR avoids copy-shifting every ApplicationData by 5 bytes, and wraps a bunch of raw slice operations. It also flushed before sending the close alert so all writes are flushed from now on.

bugadani commented 1 year ago

Yay for merge conflicts