wreq 1.3.3 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2809045eef52fee90399660465fda51499abeb7d4bdc3376a602b8663ce3418f
4
- data.tar.gz: a28ef4099948259e02efbd9f4b03ac685a10c1920aaa5d9784e5d17657af0841
3
+ metadata.gz: 5d5124d41c1dabc777c4900c161664dd48631a63058609f220dde28215df4226
4
+ data.tar.gz: ba4099331bd801fc5e80f128a4050fa8dbe266a88b904b62f538af002ffb430a
5
5
  SHA512:
6
- metadata.gz: c90aa9c18fe38d514fd75ab89318c724f3919cb513b149b1daaecc08c1b398fd067e6ba29694a554c7c37776ddbe3d33e72e1863b47718a26832e404ffc09346
7
- data.tar.gz: e886761616fbeb069f6895334cd0cd167f4477f54486c8ce5750c132a1cec72a628ef8bc9463bc0250a395d5878f38b411be22510034eefc3c96871b6aaec4b6
6
+ metadata.gz: 8bdb3b7a0a36116349bb70acc9e9eaaff3ad96a46fef9ccfde1d0f1f8a2d81dde6b5118e7cd285d95d0f2a301699f26ef1937ddd6d0aafdaf050e827471c6aeb
7
+ data.tar.gz: e41942bfaff1d484dc66c7fd14ee9849d7ea558038ea3180a4b39e8b2d08f5f9c66300589653111004ca396ad3bd6a1d72dd204cd72693586c324e616ac52141
data/Cargo.lock CHANGED
@@ -1883,7 +1883,7 @@ dependencies = [
1883
1883
  [[package]]
1884
1884
  name = "wreq"
1885
1885
  version = "0.16.1"
1886
- source = "git+https://github.com/0x676e67/wreq?rev=10029bb86ff88d8ed88b8e10518fe6e1f7ff322c#10029bb86ff88d8ed88b8e10518fe6e1f7ff322c"
1886
+ source = "git+https://github.com/0x676e67/wreq?rev=18d500474139c6740c841d3263f82a7eb1ac4883#18d500474139c6740c841d3263f82a7eb1ac4883"
1887
1887
  dependencies = [
1888
1888
  "btls",
1889
1889
  "btls-sys",
@@ -1922,7 +1922,7 @@ dependencies = [
1922
1922
 
1923
1923
  [[package]]
1924
1924
  name = "wreq-ruby"
1925
- version = "1.3.3"
1925
+ version = "1.3.5"
1926
1926
  dependencies = [
1927
1927
  "arc-swap",
1928
1928
  "bytes",
data/Cargo.toml CHANGED
@@ -5,7 +5,7 @@ authors = ["SearchApi <support@searchapi.io>"]
5
5
  homepage = "https://github.com/SearchApi/wreq-ruby"
6
6
  repository = "https://github.com/SearchApi/wreq-ruby"
7
7
  edition = "2024"
8
- version = "1.3.3"
8
+ version = "1.3.5"
9
9
  rust-version = "1.98"
10
10
 
11
11
  [lib]
@@ -79,5 +79,5 @@ netty = { git = "https://github.com/0x676e67/netty", rev = "0e1e53c0d9e500b25336
79
79
  btls = { git = "https://github.com/0x676e67/btls", rev = "5ec1c113a03626a5877b34dd6d2ea8d440897a91" }
80
80
  btls-sys = { git = "https://github.com/0x676e67/btls", rev = "5ec1c113a03626a5877b34dd6d2ea8d440897a91" }
81
81
  tokio-btls = { git = "https://github.com/0x676e67/btls", rev = "5ec1c113a03626a5877b34dd6d2ea8d440897a91" }
82
- wreq = { git = "https://github.com/0x676e67/wreq", rev = "10029bb86ff88d8ed88b8e10518fe6e1f7ff322c" }
82
+ wreq = { git = "https://github.com/0x676e67/wreq", rev = "18d500474139c6740c841d3263f82a7eb1ac4883" }
83
83
  wreq-util = { path = "crates/wreq-util" }
@@ -121,8 +121,47 @@ class ErrorHandlingTest < Minitest::Test
121
121
  end
122
122
  end
123
123
 
124
+ def test_proxy_tcp_connect_timeout_keeps_proxy_error
125
+ skip "Requires a stalled TCP handshake from a full loopback accept queue" unless RUBY_PLATFORM.include?("linux") || Gem.win_platform?
126
+
127
+ with_stalled_tcp_listener do |port|
128
+ %w[http socks5h].each do |scheme|
129
+ client = Wreq::Client.new(proxy: "#{scheme}://127.0.0.1:#{port}", connect_timeout: 1, timeout: 5)
130
+ start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
131
+
132
+ error = assert_raises(Wreq::ProxyConnectionError, "#{scheme} proxy TCP deadline") do
133
+ client.get("https://127.0.0.1:443/")
134
+ end
135
+ assert_instance_of Wreq::ProxyConnectionError, error
136
+ assert_operator Process.clock_gettime(Process::CLOCK_MONOTONIC) - start, :>=, 0.9,
137
+ "#{scheme} proxy should time out, not fail immediately"
138
+ end
139
+ end
140
+ end
141
+
124
142
  private
125
143
 
144
+ def with_stalled_tcp_listener
145
+ sockets = []
146
+ listener = Socket.new(:INET, :STREAM)
147
+ listener.bind(Socket.sockaddr_in(0, "127.0.0.1"))
148
+ listener.listen(0)
149
+ address = listener.local_address
150
+
151
+ # Leave the accept queue full and verify a subsequent dial stays pending.
152
+ pending = 8.times.any? do
153
+ socket = Socket.new(:INET, :STREAM)
154
+ sockets << socket
155
+ socket.connect_nonblock(address, exception: false) == :wait_writable &&
156
+ IO.select(nil, [socket], nil, 0.2).nil?
157
+ end
158
+ assert pending, "Expected a stalled TCP handshake on the loopback fixture"
159
+ yield address.ip_port
160
+ ensure
161
+ sockets.each(&:close)
162
+ listener&.close
163
+ end
164
+
126
165
  def with_hanging_server
127
166
  server = TCPServer.new("127.0.0.1", 0)
128
167
  accepted = Queue.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wreq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - SearchApi