lib/httpx/connection.rb in httpx-0.10.0 vs lib/httpx/connection.rb in httpx-0.10.1

- old
+ new

@@ -118,32 +118,21 @@ else @origin == connection.origin end end - def create_idle - self.class.new(@type, @origin, @options) + def create_idle(options = {}) + self.class.new(@type, @origin, @options.merge(options)) end def merge(connection) @origins += connection.instance_variable_get(:@origins) connection.purge_pending do |req| send(req) end end - def unmerge(connection) - @origins -= connection.instance_variable_get(:@origins) - purge_pending do |request| - request.uri.origin == connection.origin && begin - request.transition(:idle) - connection.send(request) - true - end - end - end - def purge_pending(&block) pendings = [] if @parser @inflight -= @parser.pending.size pendings << @parser.pending @@ -397,11 +386,11 @@ @timeout = tout end parser.on(:error) do |request, ex| case ex when MisdirectedRequestError - emit(:uncoalesce, request.uri) + emit(:misdirected, request) else response = ErrorResponse.new(request, ex, @options) request.emit(:response, response) end end @@ -433,10 +422,10 @@ if @total_timeout @total_timeout.cancel remove_instance_variable(:@total_timeout) end - @io.close + @io.close if @io @read_buffer.clear if @keep_alive_timer @keep_alive_timer.cancel remove_instance_variable(:@keep_alive_timer) end