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

Commit

Permalink
Prevent double-closure.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasa committed Feb 25, 2014
1 parent 9298d4e commit b141afe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions hyper/http20/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,7 @@ def _close_stream(self, stream_id):
"""
Called by a stream when it would like to be 'closed'.
"""
try:
del self.streams[stream_id]
except KeyError:
# If the stream is already missing from the dict, no-one cares.
pass
del self.streams[stream_id]

def _send_cb(self, frame):
"""
Expand Down
1 change: 1 addition & 0 deletions hyper/http20/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def read(self, amt=None, decode_content=True):
if decode_content and self._decompressobj:
data += self._decompressobj.flush()

if not data:
self.close()

return data
Expand Down

0 comments on commit b141afe

Please sign in to comment.