lib/httpx/connection.rb in httpx-0.18.0 vs lib/httpx/connection.rb in httpx-0.18.1

- old
+ new

@@ -115,11 +115,12 @@ # coalescable connections need to be mergeable! # but internally, #mergeable? is called before #coalescable? def coalescable?(connection) if @io.protocol == "h2" && @origin.scheme == "https" && - connection.origin.scheme == "https" + connection.origin.scheme == "https" && + @io.can_verify_peer? @io.verify_hostname(connection.origin.host) else @origin == connection.origin end end @@ -239,11 +240,11 @@ elapsed_time = @total_timeout - Utils.elapsed_time(@connected_at) if elapsed_time.negative? ex = TotalTimeoutError.new(@total_timeout, "Timed out after #{@total_timeout} seconds") ex.set_backtrace(caller) - on_error(@total_timeout) + on_error(ex) return end return elapsed_time end @@ -461,9 +462,10 @@ reset else transition(:closing) transition(:closed) emit(:reset) + @parser.reset if @parser transition(:idle) transition(:open) end end