rustls / tokio-rustls

Async TLS for the Tokio runtime
Apache License 2.0
126 stars 70 forks source link

Forward vectored writes #45

Closed paolobarbolini closed 8 months ago

paolobarbolini commented 8 months ago

Allows making use of https://github.com/rustls/rustls/pull/1640.

Supersedes #25

I've also run tests with #44 and it seems to work correctly.

Closes #25 Closes #26

paolobarbolini commented 8 months ago

Tests seem to get stuck every once in a while. It also happens on main

quininer commented 8 months ago
[tests/early-data.rs:187:9] &line = Ok(
    "wshutting down SSL",
)
[tests/early-data.rs:187:9] &line = Ok(
    "CONNECTION CLOSED",
)
[tests/early-data.rs:187:9] &line = Ok(
    "Early data received:",
)
[tests/early-data.rs:187:9] &line = Ok(
    "orld!",
)
[tests/early-data.rs:187:9] &line = Ok(
    "End of early data",
)

It seems that due to write_vectored, the probability of words (world!) being split increases. we need a better way to check openssl output.

quininer commented 8 months ago

As a performance improvement that doesn't have to block 0.23 release, I'll try to rewrite this test over the weekend (using rustls instead of openssl).

paolobarbolini commented 8 months ago

This early data situation looks weird. Even if I remove the poll_write_vectored implementation it continues to happen. It's almost like openssl doesn't like early data that is split across multiple packets.

paolobarbolini commented 8 months ago

As a performance improvement that doesn't have to block 0.23 release, I'll try to rewrite this test over the weekend (using rustls instead of openssl).

I've decided to try rewriting it myself. I opted for simplicity and left the TCP connection doing the bridging between the sync and async world. I'll rebase it later in the day once I can get back to this.

quininer commented 8 months ago

I have a branch based on tokio-rustls server, but I think it would be nice to use a sync implement. thank you.

quininer commented 8 months ago

Thank you!