This repository was archived by the owner on Jan 13, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1067,6 +1067,29 @@ def test_goaway_frame_invalid_error_code(self):
1067
1067
1068
1068
assert str (f .error_code ) in err_msg
1069
1069
1070
+ def test_resetting_streams_after_close (self ):
1071
+ """
1072
+ Attempts to reset streams when the connection is torn down are
1073
+ tolerated.
1074
+ """
1075
+ f = SettingsFrame (0 )
1076
+
1077
+ c = HTTP20Connection ('www.google.com' )
1078
+ c ._sock = DummySocket ()
1079
+ c ._sock .buffer = BytesIO (f .serialize ())
1080
+
1081
+ # Open stream 1.
1082
+ c .request ('GET' , '/' )
1083
+
1084
+ # Swap out the buffer to get a GoAway frame.
1085
+ f = GoAwayFrame (0 )
1086
+ f .error_code = 1
1087
+ c ._sock .buffer = BytesIO (f .serialize ())
1088
+
1089
+ # "Read" the GoAway
1090
+ with pytest .raises (ConnectionError ):
1091
+ c ._single_read ()
1092
+
1070
1093
1071
1094
# Some utility classes for the tests.
1072
1095
class NullEncoder (object ):
@@ -1107,6 +1130,7 @@ def buffer(self):
1107
1130
@buffer .setter
1108
1131
def buffer (self , value ):
1109
1132
self ._buffer = value
1133
+ self ._read_counter = 0
1110
1134
1111
1135
def advance_buffer (self , amt ):
1112
1136
self ._read_counter += amt
You can’t perform that action at this time.
0 commit comments