Commit afbb6b79 authored by Tiago's avatar Tiago
Browse files

connection: when idling, before resetting the parser, route any possible...

connection: when idling, before resetting the parser, route any possible requests that became pending back to the connections
parent 17dbd157
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -270,11 +270,11 @@ module HTTPX
        enqueue_pending_requests_from_parser(parser)
      end

      if @pending.empty?
      return unless @pending.empty?

      disconnect
      emit(:force_closed, delete_pending)
    end
    end

    # bypasses the state machine to force closing of connections still connecting.
    # **only** used for Happy Eyeballs v2.
@@ -338,7 +338,10 @@ module HTTPX
      purge_after_closed
      @write_buffer.clear
      transition(:idle)
      @parser = nil if @parser
      return unless @parser

      enqueue_pending_requests_from_parser(parser)
      @parser = nil
    end

    def used?