From 9e9b2145d9cc0810307d620a5a87237ab41e3e70 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Thu, 2 Feb 2023 19:16:29 +0000 Subject: [PATCH 1/2] Enhanced RDoc for write_timeout --- lib/net/http.rb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/net/http.rb b/lib/net/http.rb index c8c18506..ca87f265 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -530,7 +530,7 @@ def HTTP.post_form(url, params) # \HTTP session management # - # Returns intger +80+, the default port to use for \HTTP requests: + # Returns integer +80+, the default port to use for \HTTP requests: # # Net::HTTP.default_port # => 80 # @@ -1048,7 +1048,21 @@ def read_timeout=(sec) # Sets the write timeout, in seconds, for +self+ to integer +sec+; # the initial value is 60. # - # Argument +sec+ must be a non-negative numeric value. + # Argument +sec+ must be a non-negative numeric value: + # + # _uri = uri.dup + # _uri.path = '/posts' + # body = 'bar' * 200000 + # data = < # + # http.write_timeout = 0 + # http.post(_uri.path, data, headers) + # # => # # def write_timeout=(sec) @socket.write_timeout = sec if @socket From d24d96898f6c04a363222a8eb3df83d1f4e87f4e Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Thu, 2 Feb 2023 16:32:46 -0600 Subject: [PATCH 2/2] Update http.rb --- lib/net/http.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/net/http.rb b/lib/net/http.rb index ca87f265..0be6db93 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1061,8 +1061,7 @@ def read_timeout=(sec) # http.post(_uri.path, data, headers) # # => # # http.write_timeout = 0 - # http.post(_uri.path, data, headers) - # # => # + # http.post(_uri.path, data, headers) # Raises Net::WriteTimeout. # def write_timeout=(sec) @socket.write_timeout = sec if @socket