Skip to content

Commit

Permalink
extra http validation
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Jul 31, 2018
1 parent 4688ec4 commit 1862ec4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/netius/clients/http.py
Expand Up @@ -1341,6 +1341,8 @@ def method(
# notice that the event loop is also re-used accordingly
key = cls.protocol.key_g(url)
protocol = self.available.pop(key, None)
if protocol and (not protocol.is_open() or\
protocol.transport().is_closing()): protocol = None
if protocol: loop = loop or protocol.loop()

# determines if the loop instance was provided by the user so
Expand Down Expand Up @@ -1387,7 +1389,7 @@ def method(
protocol.connection_made(protocol.transport())

# runs the global connect stream function on netius to initialize the
# connection operation and maybe anew event loop (if that's required)
# connection operation and maybe a new event loop (if that's required)
else:
loop = netius.connect_stream(
lambda: protocol,
Expand Down

0 comments on commit 1862ec4

Please sign in to comment.