Commit c8a5ac1a authored by Tiago's avatar Tiago
Browse files

fix: close on disconnect, check state after

#close implementations rely on current state check first, so no point in checking for state before

the post-check is there for the case where httpx is used inside a fiber scheduler, and the state may have retransitioned because the resolver was reopened
parent 1b023689
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -199,9 +199,10 @@ module HTTPX
    end

    def disconnect
      close

      return if closed?

      close
      @current_session.deselect_resolver(self, @current_selector)
    end
  end