-
Notifications
You must be signed in to change notification settings - Fork 69
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
Override poll_write_vectored
?
#26
Comments
I agree with impl Currently, rustls does not provide backpressure https://github.com/rustls/rustls/blob/v/0.21.8/rustls/src/conn.rs#L232 . If we want to impl buffer write without rustls support, we can treat rustls writer as an infinite buffer and set a reasonable buffer length ourselves. But this is a huge behavior change. and if rustls hopes to provide a write-through API in future, it would be reasonable to keep current behavior. tokio-rs/tls#136 (comment) cc @djc |
I don't think I am following you there. Isn't that orthogonal to vectored writes? For The docs for |
Yes, they are orthogonal. the buffer writer is just a related discussion of this line.
|
The write-through API is currently being worked on. rustls/rustls#1420 |
With rustls/rustls#1640 this could make sense to have. I may find some time to look into it. |
At present,
poll_write_vectored
is not overridden:tokio-rustls/src/common/mod.rs
Lines 290 to 324 in 6df177a
I think it would make sense to do so though. At the moment, the implementation of
poll_write
will perform IO as soon as the buffer is written (which makes sense). However, if the application would have more data to send that sits in different buffers, performing IO after everypoll_write
might lead to multiple TCP packets being sent.The only way around this (I think?) would be to re-design the upper layer to be able to provide a single byte buffer. That is not always feasible and/or desirable. Additionally, that is exactly what
poll_write_vectored
is for. A proper implementation of would send all packets down to the rustls session and only perform IO once that buffer is either full or we've written all buffers passed to us.I've created a basic draft in #25.
The text was updated successfully, but these errors were encountered: