Skip to content

Commit

Permalink
[recovery] send an INITIAL probe when handshake key is unavailable
Browse files Browse the repository at this point in the history
If the server ACKs all the client's INITIAL packets but the client doesn't
yet have a HANDSHAKE key, we need to send out a PING frame in an INITIAL
packet. Ensure this packet is padded to gain anti-amplification credit.
  • Loading branch information
jlaine committed Jun 25, 2020
1 parent e2b0dac commit 50fb0f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/aioquic/quic/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2567,8 +2567,11 @@ def _write_handshake(
# PING (probe)
if (
self._probe_pending
and epoch == tls.Epoch.HANDSHAKE
and not self._handshake_complete
and (
epoch == tls.Epoch.HANDSHAKE
or not self._cryptos[tls.Epoch.HANDSHAKE].send.is_valid()
)
):
self._write_ping_frame(builder, comment="probe")
self._probe_pending = False
Expand Down
2 changes: 1 addition & 1 deletion src/aioquic/quic/packet_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def _end_packet(self) -> None:
if (
self._is_client
and self._packet_type == PACKET_TYPE_INITIAL
and self._packet.is_crypto_packet
and self._packet.is_ack_eliciting
and self.remaining_flight_space
and self.remaining_flight_space > padding_size
):
Expand Down

0 comments on commit 50fb0f7

Please sign in to comment.