Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 2ab9328

Browse files
committed
Don't emit RST_STREAM frame on data exhaustion
Fixes #149.
1 parent 020f266 commit 2ab9328

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

HISTORY.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ dev
1212
*Bugfixes*
1313

1414
- Prevent hyper from emitting oversized frames. Thanks to @jdecuyper!
15+
- Prevent hyper from emitting RST_STREAM frames whenever it finishes consuming
16+
a stream.
1517

1618
*Software Updates*
1719

18-
- Updated hyperframe to version 1.1.0.
20+
- Updated hyperframe to version 1.1.1.
1921

2022
0.4.0 (2015-06-21)
2123
------------------

hyper/http20/connection.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,10 @@ def _close_stream(self, stream_id, error_code=None):
500500
"""
501501
Called by a stream when it would like to be 'closed'.
502502
"""
503-
self._send_rst_frame(stream_id, error_code)
503+
# Graceful shutdown of streams involves not emitting an error code
504+
# at all.
505+
if error_code:
506+
self._send_rst_frame(stream_id, error_code)
504507

505508
def _send_cb(self, frame, tolerate_peer_gone=False):
506509
"""
@@ -519,6 +522,9 @@ def _send_cb(self, frame, tolerate_peer_gone=False):
519522

520523
self._out_flow_control_window -= len(frame.data)
521524

525+
if frame.type == RstStreamFrame.type:
526+
import pdb; pdb.set_trace()
527+
522528
data = frame.serialize()
523529

524530
max_frame_size = self._settings[SettingsFrame.SETTINGS_MAX_FRAME_SIZE]

0 commit comments

Comments
 (0)