@@ -1333,6 +1333,12 @@ def _handle_datagram_frame(
1333
1333
length = buf .capacity - start
1334
1334
data = buf .pull_bytes (length )
1335
1335
1336
+ # log frame
1337
+ if self ._quic_logger is not None :
1338
+ context .quic_logger_frames .append (
1339
+ self ._quic_logger .encode_datagram_frame (length = length )
1340
+ )
1341
+
1336
1342
# check frame is allowed
1337
1343
if (
1338
1344
self ._configuration .max_datagram_frame_size is None
@@ -1346,12 +1352,6 @@ def _handle_datagram_frame(
1346
1352
1347
1353
self ._events .append (events .DatagramFrameReceived (data = data ))
1348
1354
1349
- # log frame
1350
- if self ._quic_logger is not None :
1351
- context .quic_logger_frames .append (
1352
- self ._quic_logger .encode_datagram_frame (length = length )
1353
- )
1354
-
1355
1355
def _handle_max_data_frame (
1356
1356
self , context : QuicReceiveContext , frame_type : int , buf : Buffer
1357
1357
) -> None :
@@ -1489,19 +1489,19 @@ def _handle_new_token_frame(
1489
1489
length = buf .pull_uint_var ()
1490
1490
token = buf .pull_bytes (length )
1491
1491
1492
+ # log frame
1493
+ if self ._quic_logger is not None :
1494
+ context .quic_logger_frames .append (
1495
+ self ._quic_logger .encode_new_token_frame (token = token )
1496
+ )
1497
+
1492
1498
if not self ._is_client :
1493
1499
raise QuicConnectionError (
1494
1500
error_code = QuicErrorCode .PROTOCOL_VIOLATION ,
1495
1501
frame_type = frame_type ,
1496
1502
reason_phrase = "Clients must not send NEW_TOKEN frames" ,
1497
1503
)
1498
1504
1499
- # log frame
1500
- if self ._quic_logger is not None :
1501
- context .quic_logger_frames .append (
1502
- self ._quic_logger .encode_new_token_frame (token = token )
1503
- )
1504
-
1505
1505
def _handle_padding_frame (
1506
1506
self , context : QuicReceiveContext , frame_type : int , buf : Buffer
1507
1507
) -> None :
0 commit comments