Description
Checklist
- I've searched the issue tracker for similar bugs.
Describe the bug
I've updated my pipebuf
crate Rustls wrapper in crate pipebuf_rustls
to add unbuffered Rustls support. However my tests which succeed in the buffered mode fail for the unbuffered mode. The failing test does the following:
- Client sends one byte
- Client closes connection
- Server sends one byte
- Server closes connection
The byte sent by the server cannot be processed through the unbuffered interface because the process_tls_records
call does not give a WriteTraffic
state again after Closed
. Without access to WriteTraffic
, I can't send the data. The buffered interface does not have this limitation.
To Reproduce
Check out pipebuf_rustls
from github (https://github.com/uazu/pipebuf_rustls). Run a single test using cargo test --no-default-features --features unbuffered byte_each_way
. There is an assertion failure due to 1 byte sent but 0 bytes received.
Applicable Version(s)
0.23.4 on Linux
Expected behavior
I'd expect this case to be supported. I don't know how you'd want to support it with your unbuffered API though.
Additional context
The reason I added unbuffered support to pipebuf_rustls
was that this is a much better fit to the pipebuf
model. I added PBufRd::data_mut
to pipebuf
0.3.1 to support Rustls unbuffered mode (which requires &mut [u8]
for incoming data). So I support the unbuffered effort. Just it doesn't cover all necessary cases yet.