rustls/rustls/tests
Daniel McCarney 60cfb9b4cf conn: ensure complete_io flushes pending writes.
Previously, calls to `complete_io()` may return as if handshaking has
completed, but leave pending TLS writes queued that won't be sent until
a subsequent call to `complete_io()` is made.

This happens because `is_handshaking()` can begin to return false after
calls to `process_new_packets()` while there are final handshake packets
put in the connection's buffers, but not yet extracted to be sent to the
peer.

The end result is that calling `complete_io()` once is not
sufficient to fully complete a handshake with a peer. A second call
was required to flush the pending packets.

In this commit the `complete_io()` logic is updated to continue
processing IO when calling `process_new_packets()` has queued TLS
writes, only returning to the caller when all pending IO has been dealt
with and the handshake truly completed.

We can test this behaviour by updating the
`client_complete_io_for_handshake` and
`server_complete_io_for_handshake` unit tests to assert there are no
pending TLS writes after calling `complete_io()`. Prior to this commit
these assertions would fail, and with the updated logic they pass as
expected.
2023-04-17 17:20:39 +02:00
..
common Revert "Remove `PartialEq` from `rustls::Error`" 2023-03-28 09:26:47 +02:00
api.rs conn: ensure complete_io flushes pending writes. 2023-04-17 17:20:39 +02:00
bogo.rs Measure coverage using cargo-llvm-cov 2022-12-31 13:23:01 +00:00
client_cert_verifier.rs OwnedTrustAnchor: subject is a DistinguishedName 2023-03-29 09:18:40 +02:00
key_log_file_env.rs Restore thread-safety to the integration test suite w.r.t. `env::set_var`. 2022-01-22 11:27:08 +00:00
server_cert_verifier.rs Revert "Remove `PartialEq` from `rustls::Error`" 2023-03-28 09:26:47 +02:00