ruby-changes:10591
From: knu <ko1@a...>
Date: Mon, 9 Feb 2009 12:15:21 +0900 (JST)
Subject: [ruby-changes:10591] Ruby:r22148 (ruby_1_8): r22137@crimson: knu | 2009-02-08 21:40:10 +0900
knu 2009-02-09 12:15:14 +0900 (Mon, 09 Feb 2009) New Revision: 22148 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22148 Log: r22137@crimson: knu | 2009-02-08 21:40:10 +0900 * add :read_timeout option. [ruby-core:4848] (r9166) Modified directories: branches/ruby_1_8/ Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/lib/open-uri.rb Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 22147) +++ ruby_1_8/ChangeLog (revision 22148) @@ -1,3 +1,8 @@ +Sun Feb 8 21:39:06 2009 Akinori MUSHA <knu@i...> + + * lib/open-uri.rb: add :read_timeout option. + [ruby-core:4848] (r9166) + Mon Feb 9 01:21:16 2009 Tanaka Akira <akr@f...> * ext/socket/socket.c (unix_recv_io): relax msg_controllen error Index: ruby_1_8/lib/open-uri.rb =================================================================== --- ruby_1_8/lib/open-uri.rb (revision 22147) +++ ruby_1_8/lib/open-uri.rb (revision 22148) @@ -94,6 +94,7 @@ :progress_proc => true, :content_length_proc => true, :http_basic_authentication => true, + :read_timeout => true, } def OpenURI.check_options(options) # :nodoc: @@ -234,6 +235,9 @@ 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 } @@ -511,6 +515,13 @@ # 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. # The IO object is extended with OpenURI::Meta. Property changes on: ruby_1_8 ___________________________________________________________________ Name: svk:merge + 050cfa88-b445-4b2e-b226-957b86f2c464:/local/ruby/1.8:22137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e:/trunk:5286 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/