Compare commits

...

4 Commits

Author SHA1 Message Date
HoneyryderChuck
8559a3eef8 bumping version to 0.22.4 2023-02-08 20:44:33 +00:00
HoneyryderChuck
f69af8ddfe Merge branch 'issue-227' into 'master'
happy eyeballs v2: fix bug of connection merging with itself

Closes #227

See merge request os85/httpx!240
2023-02-08 20:23:55 +00:00
HoneyryderChuck
18cb21888f linting error 2023-02-08 20:05:40 +00:00
HoneyryderChuck
ff59a4c279 happy eyeballs v2: fix bug of connection merging with itself
Given a sequence of events, where IPv4 and IPv6 addresses are emitted,
and IPv6 wins the race, the IPv4 may already be in an advanced state of
registering that it'll find the IPv6 connection, and it will coalesce
with it. In such a case, the `:tcp_open` callback will emitted for the
IPv6 connection, which will merge and shut itself down.

Ths caused hanging requests.
2023-02-08 18:34:59 +00:00
4 changed files with 12 additions and 4 deletions

View File

@ -0,0 +1,6 @@
# 0.22.4
## Bugfixes
* fix happy eyeballs v2 bug where, once the first connection would be established, the remaining one would still end up in the coalescing loop, thereby closing itself via the `:tcp_open` callback.
* fix for faraday plugin parallel mode, where it'd hang if no requests would be made in the parallel block (@catlee)

View File

@ -147,8 +147,10 @@ module HTTPX
end
new_connection.once(:tcp_open) do |new_conn|
new_conn.merge(connection)
connection.force_reset
if new_conn != connection
new_conn.merge(connection)
connection.force_reset
end
end
new_connection.once(:connect_error) do |err|
if connection.connecting?

View File

@ -73,7 +73,7 @@ module HTTPX
end
def params_hash_has_key?(hash, key)
return false if /\[\]/.match?(key)
return false if key.include?("[]")
key.split(/[\[\]]+/).inject(hash) do |h, part|
next h if part == ""

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
module HTTPX
VERSION = "0.22.3"
VERSION = "0.22.4"
end