Skip to content

Commit

Permalink
[logger] log packet_dropped with reason header_parse_error
Browse files Browse the repository at this point in the history
Some servers add all zero padding to UDP datagrams during the handshake.
  • Loading branch information
pyfisch authored and jlaine committed Oct 18, 2022
1 parent 1445660 commit 91e0cc0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/aioquic/quic/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,15 @@ def receive_datagram(self, data: bytes, addr: NetworkAddress, now: float) -> Non
buf, host_cid_length=self._configuration.connection_id_length
)
except ValueError:
if self._quic_logger is not None:
self._quic_logger.log_event(
category="transport",
event="packet_dropped",
data={
"trigger": "header_parse_error",
"raw": {"length": buf.capacity - start_off},
},
)
return

# check destination CID matches
Expand Down

0 comments on commit 91e0cc0

Please sign in to comment.