| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/net-http/commit/8cee86e939
|
|
Freeze Net::HTTP::SSL_ATTRIBUTES and IDEMPOTENT_METHODS_. Both constants
have been marked as :nodoc:.
Together with https://github.com/ruby/openssl/issues/521, this enables
HTTPS clients in non-main Ractors on Ruby 4.0.
https://github.com/ruby/net-http/commit/f24b3b358b
|
|
https://github.com/ruby/net-http/commit/3ccf0c8e6a
|
|
specified timeout (#15602)
* `Socket.tcp` and `TCPSocket.new` raises `IO::TiemoutError` with user specified timeout
In https://github.com/ruby/ruby/pull/11880, `rsock_connect()` was changed to raise `IO::TimeoutError` when a user-specified timeout occurs.
However, when `TCPSocket.new` attempts to connect to multiple destinations, it does not use `rsock_connect()`, and instead raises `Errno::ETIMEDOUT` on timeout.
As a result, the exception class raised on timeout could differ depending on whether there were multiple destinations or not.
To align this behavior with the implementation of `rsock_connect()`, this change makes `TCPSocket.new` raise `IO::TimeoutError` when a user-specified timeout occurs.
Similarly, `Socket.tcp` is updated to raise `IO::TimeoutError` when a timeout occurs within the method.
(Note that the existing behavior of `Addrinfo#connect_internal`, which Socket.tcp depends on internally and which raises `Errno::ETIMEDOUT` on timeout, is not changed.)
* [ruby/net-http] Raise `Net::OpenTimeout` when `TCPSocket.open` raises `IO::TimeoutError`.
With the changes in https://github.com/ruby/ruby/pull/15602, `TCPSocket.open` now raises `IO::TimeoutError` when a user-specified timeout occurs.
This change updates #connect to handle this case accordingly.
https://github.com/ruby/net-http/commit/f64109e1cf
|
|
once and without exceptions
* See discussion in https://github.com/ruby/net-http/pull/224
* This check is known to work on at least CRuby, TruffleRuby and JRuby.
* Exceptions show up with `ruby -d`/`$DEBUG == true` and would show for every Net::HTTP instance.
https://github.com/ruby/net-http/commit/8c76f92779
|
|
|
|
The try-open_timeout-then-fallback-to-timeout introduced in
https://github.com/ruby/net-http/commit/1903cedd8cd0 works well, but when it errors
due to any reason in Rubies which do not support `open_timeout`, it
spits the rescued ArgumentError that is unrelated to user code and not
actionable.
Net::HTTP.start('foo.bar', 80)
/.../net-http-0.8.0/lib/net/http.rb:1691:in 'TCPSocket#initialize': Failed to open TCP connection to foo.bar:80 (getaddrinfo(3): nodename nor servname provided, or not known) (Socket::ResolutionError)
from /.../net-http-0.8.0/lib/net/http.rb:1691:in 'IO.open'
from /.../net-http-0.8.0/lib/net/http.rb:1691:in 'block in Net::HTTP#connect'
from /.../timeout-0.4.4/lib/timeout.rb:188:in 'block in Timeout.timeout'
from /.../timeout-0.4.4/lib/timeout.rb:195:in 'Timeout.timeout'
from /.../net-http-0.8.0/lib/net/http.rb:1690:in 'Net::HTTP#connect'
from /.../net-http-0.8.0/lib/net/http.rb:1655:in 'Net::HTTP#do_start'
from /.../net-http-0.8.0/lib/net/http.rb:1635:in 'Net::HTTP#start'
from /.../net-http-0.8.0/lib/net/http.rb:1064:in 'Net::HTTP.start'
(snip)
/.../net-http-0.8.0/lib/net/http.rb:1682:in 'TCPSocket#initialize': unknown keyword: :open_timeout (ArgumentError)
sock = TCPSocket.open(conn_addr, conn_port, @local_host, @local_port, open_timeout: @open_timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
from /.../net-http-0.8.0/lib/net/http.rb:1682:in 'IO.open'
from /.../net-http-0.8.0/lib/net/http.rb:1682:in 'Net::HTTP#connect'
from /.../net-http-0.8.0/lib/net/http.rb:1655:in 'Net::HTTP#do_start'
from /.../net-http-0.8.0/lib/net/http.rb:1635:in 'Net::HTTP#start'
from /.../net-http-0.8.0/lib/net/http.rb:1064:in 'Net::HTTP.start'
(snip)
... 8 levels...
This patch suppresses the ArgumentError by moving the retry out of the
rescue clause.
https://github.com/ruby/net-http/commit/86232d62f5
|
|
https://github.com/ruby/net-http/commit/9d65391f54
|
|
This commit updates the Ruby version to follow the commit in Ruby master branch.
https://github.com/ruby/ruby/commit/6d81969b475262aba251e99b518181bdf7c5a523
https://github.com/ruby/net-http/commit/1e48cfaaf7
|
|
For open_timeout support detection, the previous implementation relied
on an ArgumentError being raised and then rescued. In Ruby, rescue is a
rather expensive operation and should be avoided when possible.
This patch reduces the number of begin-rescues by remembering if the
TCPSocket implementation supports open_timeout.
https://github.com/ruby/net-http/commit/06d982f3a1
|
|
https://github.com/ruby/net-http/commit/09bf573dd5
|
|
when available
This patch replaces the implementation of #open_timeout from Timeout.timeout from the builtin timeout in TCPSocket.open, which was introduced in Ruby 3.5 (https://bugs.ruby-lang.org/issues/21347).
The builtin timeout in TCPSocket.open is better in several ways than Timeout.timeout. It does not rely on a separate Ruby Thread for monitoring Timeout (which is what the timeout library internally does).
Furthermore, it is compatible with Ractors, as opposed to Timeout.timeout (it internally uses Thread::Mutex which can not be used in non-main Ractors).
This change allows the following code to work.
require 'net/http'
Ractor.new {
uri = URI('http://example.com/')
http = Net::HTTP.new(uri.host, uri.port)
http.open_timeout = 1
http.get(uri.path)
}.value
In Ruby <3.5 environments where `TCPSocket.open` does not have the `open_timeout` option, I have kept the behavior unchanged. net/http will use `Timeout.timeout { TCPSocket.open }`.
https://github.com/ruby/net-http/commit/728eb8fc42
|
|
This reverts commit af610e107c3a7515228843eb6b1c5978f2ee2685.
Reverted by a mistake.
|
|
This reverts commit 155cdce539a95b510a80a19e3840cde6b293cd4d.
|
|
https://github.com/ruby/net-http/commit/58685b78ab
|
|
https://github.com/ruby/net-http/commit/e4d80bd609
|
|
https://github.com/ruby/net-http/commit/ec9c70a6fb
|
|
Freeze `Net::HTTP::SSL_IVNAMES`, `Net::HTTPResponse::CODE_CLASS_TO_OBJ`
and `Net::HTTPResponse::CODE_TO_OBJ` to improve Ractor compatibility.
This change allows the following code to work:
Ractor.new {
uri = URI.parse('http://example.com')
http = Net::HTTP.new(uri.host, uri.port)
http.open_timeout = nil
http.read_timeout = nil
http.get('/index.html')
}
https://github.com/ruby/net-http/commit/9f0f5e4b4d
|
|
provided snce Ruby 2.3
Notes:
Merged: https://github.com/ruby/ruby/pull/13311
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13275
|
|
https://github.com/ruby/net-http/commit/9bcf818fd009eafb11107c7457aa56d533d16d94
https://github.com/ruby/net-http/commit/5e34e74261f40f4f10c93d7700761c437117f494
Notes:
Merged: https://github.com/ruby/ruby/pull/12362
|
|
https://github.com/ruby/net-http/commit/6475fa68ba
|
|
https://github.com/ruby/net-http/commit/4650f86981
|
|
https://github.com/ruby/net-http/commit/37f17d29e0
|
|
These constants, isolated in net/http/backward.rb, have not only been
deprecated since 2001, but have also had a warning since 2021.
https://github.com/ruby/net-http/commit/265bfa929f
|
|
https://github.com/ruby/net-http/commit/28a4bf9295
|
|
https://bugs.ruby-lang.org/issues/16482
https://github.com/ruby/net-http/commit/ae2d83f88b
|
|
https://github.com/ruby/net-http/commit/fed3dcd0c2
|
|
https://github.com/ruby/net-http/commit/7191bb923b
|
|
https://github.com/ruby/net-http/commit/6dc01c985b
|
|
https://github.com/ruby/net-http/commit/3bf641ca63
|
|
If a socket error occurs while performing a streaming download via
the response block provided to transport_request, avoid calling
the response block again as this would result in duplicate data
received by the client.
Fixes https://github.com/ruby/net-http/pull/86
Fixes https://github.com/ruby/net-http/pull/87
Fixes [Bug #11526]
https://github.com/ruby/net-http/commit/114d01b092
Co-authored-by: Jeremy Stanley <jeremy@instructure.com>
|
|
https://github.com/ruby/net-http/commit/21e226c0bc
|
|
https://github.com/ruby/net-http/commit/4be99c204c
|
|
https://github.com/ruby/net-http/commit/c1c5638014
|
|
https://github.com/ruby/net-http/commit/f4951dc42a
|
|
See #144
https://github.com/ruby/net-http/commit/5a986c13d3
|
|
@natematykiewicz's suggestion to avoid another string allocation
https://github.com/ruby/net-http/commit/4a22c42338
Co-authored-by: Nate Matykiewicz <natematykiewicz@gmail.com>
|
|
https://github.com/ruby/net-http/commit/5194fd541e
|
|
https://github.com/ruby/net-http/commit/455a74734a
|
|
https://github.com/ruby/net-http/commit/d22ca54904de after
testing
https://github.com/ruby/net-http/commit/7ac7401a9c
|
|
Also revert commit https://github.com/ruby/net-http/commit/d22ca54904de "Replaced
non-ascii charactor. It fails version detection at `net-http.gemspec`."
https://github.com/ruby/net-http/commit/fbeb247d93
|
|
># Returns the X509 certificate chain for the session<E2><80><99>s socket peer.
|
|
(https://github.com/ruby/net-http/pull/128)
https://github.com/ruby/net-http/commit/39e70f0f9b
|
|
(https://github.com/ruby/net-http/pull/127)
https://github.com/ruby/net-http/commit/07b2b88ef5
|
|
(https://github.com/ruby/net-http/pull/126)
https://github.com/ruby/net-http/commit/4700d0660b
|
|
(https://github.com/ruby/net-http/pull/125)
https://github.com/ruby/net-http/commit/2ea20380fc
|
|
(https://github.com/ruby/net-http/pull/124)
https://github.com/ruby/net-http/commit/aaf26b21d6
|
|
(https://github.com/ruby/net-http/pull/123)
https://github.com/ruby/net-http/commit/220ff3f741
|
|
(https://github.com/ruby/net-http/pull/122)
https://github.com/ruby/net-http/commit/06f79cda87
|