@@ -390,17 +390,22 @@ def test_resets_further_frames_after_recv_reset(self,
390390 assert not events
391391 assert c .data_to_send () == rst_frame .serialize ()
392392
393+ # "An endpoint MUST ignore frames that it receives on closed streams
394+ # after it has sent a RST_STREAM frame."
395+ # The initial RST_STREAM was seen in the previous assert. Additional
396+ # frames should be ignored.
393397 events = c .receive_data (f .serialize () * 3 )
394398 assert not events
395- assert c .data_to_send () == rst_frame . serialize () * 3
399+ assert c .data_to_send () == b""
396400
397401 # Iterate over the streams to make sure it's gone, then confirm the
398402 # behaviour is unchanged.
399403 c .open_outbound_streams
400404
405+ # Additional frames should continue to be ignored
401406 events = c .receive_data (f .serialize () * 3 )
402407 assert not events
403- assert c .data_to_send () == rst_frame . serialize () * 3
408+ assert c .data_to_send () == b""
404409
405410 def test_resets_further_data_frames_after_recv_reset (self ,
406411 frame_factory ):
@@ -486,6 +491,7 @@ def test_resets_further_frames_after_send_reset(self,
486491 end_stream = False
487492 )
488493
494+ # Send initial RST_STREAM
489495 c .reset_stream (1 , h2 .errors .ErrorCodes .INTERNAL_ERROR )
490496
491497 rst_frame = frame_factory .build_rst_stream_frame (
@@ -496,23 +502,24 @@ def test_resets_further_frames_after_send_reset(self,
496502 f = frame (self , frame_factory )
497503 events = c .receive_data (f .serialize ())
498504
499- rst_frame = frame_factory .build_rst_stream_frame (
500- 1 , h2 .errors .ErrorCodes .STREAM_CLOSED
501- )
505+ # "An endpoint MUST ignore frames that it receives on closed streams
506+ # after it has sent a RST_STREAM frame."
507+ # The initial RST_STREAM was sent in the test setup. Additional frames
508+ # should be ignored.
502509 assert not events
503- assert c .data_to_send () == rst_frame . serialize ()
510+ assert c .data_to_send () == b""
504511
505512 events = c .receive_data (f .serialize () * 3 )
506513 assert not events
507- assert c .data_to_send () == rst_frame . serialize () * 3
514+ assert c .data_to_send () == b""
508515
509516 # Iterate over the streams to make sure it's gone, then confirm the
510517 # behaviour is unchanged.
511518 c .open_outbound_streams
512519
513520 events = c .receive_data (f .serialize () * 3 )
514521 assert not events
515- assert c .data_to_send () == rst_frame . serialize () * 3
522+ assert c .data_to_send () == b""
516523
517524 def test_resets_further_data_frames_after_send_reset (self ,
518525 frame_factory ):
0 commit comments