Skip to content

Commit

Permalink
Merge pull request #254 from nbraem/master
Browse files Browse the repository at this point in the history
connection leak fix for #253
  • Loading branch information
fafhrd91 committed Jan 22, 2015
2 parents c587340 + 5dd86d0 commit 07cd477
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aiohttp/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ def _release(self, key, req, transport, protocol, *, should_close=False):

reader = protocol.reader
if should_close or (reader.output and not reader.output.at_eof()):
self._conns.pop(key, None)
conns = self._conns.get(key)
if conns is not None and len(conns) == 0:
self._conns.pop(key, None)
transport.close()
else:
conns = self._conns.get(key)
Expand Down

0 comments on commit 07cd477

Please sign in to comment.