[#4858] Build fails on OSX Tiger 10.4 — noreply@...

Bugs item #1883, was opened at 2005-05-06 14:55

21 messages 2005/05/06
[#4862] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — Yukihiro Matsumoto <matz@...> 2005/05/07

Hi,

[#4865] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — Ryan Davis <ryand-ruby@...> 2005/05/07

[#4868] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — nobu.nokada@... 2005/05/07

Hi,

[#5053] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — Shugo Maeda <shugo@...> 2005/05/19

Hi,

[#5056] Re: [ ruby-Bugs-1883 ] Build fails on OSX Tiger 10.4 — Mark Hubbart <discordantus@...> 2005/05/19

On 5/19/05, Shugo Maeda <shugo@ruby-lang.org> wrote:

[#4874] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...>

Hello all,

31 messages 2005/05/10
[#4879] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Pit Capitain <pit@...> 2005/05/11

Ilias Lazaridis schrieb:

[#4883] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...> 2005/05/12

Pit Capitain wrote:

[#4884] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Ryan Davis <ryand-ruby@...> 2005/05/12

[#4888] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...> 2005/05/12

Ryan Davis wrote:

[#4889] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — ES <ruby-ml@...> 2005/05/12

[#4890] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Ilias Lazaridis <ilias@...> 2005/05/12

ES wrote:

[#4891] Re: [THIN] - Need to reduce Ruby Sources to the Minimal — Alexander Kellett <ruby-lists@...> 2005/05/12

On May 12, 2005, at 3:13 PM, Ilias Lazaridis wrote:

[#4911] Pointless argc check in Array#select — noreply@...

Patches item #1900, was opened at 2005-05-12 09:33

11 messages 2005/05/12

[#4919] - Hierarchical/Modular Directory Structure — Ilias Lazaridis <ilias@...>

The source-code structure should be simplified, lowering barriers for

20 messages 2005/05/12

Re: [ ruby-Bugs-1878 ] No way to change socket timeout on opened URI

From: Tanaka Akira <akr@...17n.org>
Date: 2005-05-07 14:32:50 UTC
List: ruby-core #4867
In article <200505052255.j45MtVam031547@rubyforge.org>,
  noreply@rubyforge.org writes:

> open-uri is very handy, but as far as I can tell I can't change the read timeout
> on the underlying socket.  I end up having to hack a workaround into Net::HTTP
> to allow me to set a timeout on its instances before opening the URI.

Does adding :read_timeout option solve the problem?

Index: lib/open-uri.rb
===================================================================
RCS file: /src/ruby/lib/open-uri.rb,v
retrieving revision 1.36
diff -u -p -r1.36 open-uri.rb
--- lib/open-uri.rb	19 Feb 2005 15:53:23 -0000	1.36
+++ lib/open-uri.rb	7 May 2005 14:26:52 -0000
@@ -97,6 +97,7 @@ module OpenURI
     :progress_proc => true,
     :content_length_proc => true,
     :http_basic_authentication => true,
+    :read_timeout => true,
   }
 
   def OpenURI.check_options(options) # :nodoc:
@@ -237,6 +238,9 @@ module OpenURI
       store.set_default_paths
       http.cert_store = store
     end
+    if options.include? :read_timeout
+      http.read_timeout = options[:read_timeout]
+    end
 
     header = {}
     options.each {|k, v| header[k] = v if String === k }
@@ -518,6 +522,13 @@ module OpenURI
     #      :progress_proc => lambda {|s|
     #        pbar.set s if pbar
     #      }) {|f| ... }
+    #
+    # [:read_timeout]
+    #  Synopsis:
+    #    :read_timeout=>nil     (no timeout)
+    #    :read_timeout=>10      (10 second)
+    #
+    #  :read_timeout option specifies a timeout of read for http connections.
     #
     # OpenURI::OpenRead#open returns an IO like object if block is not given.
     # Otherwise it yields the IO object and return the value of the block.
-- 
Tanaka Akira

In This Thread