< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #6957 has been reported by kl (Kalle Lindstr旦m).
----------------------------------------
Bug #6957: Net::HTTP#request_get bug
https://bugs.ruby-lang.org/issues/6957
Author: kl (Kalle Lindstr旦m)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 1.9.3p194 (2012-04-20) [i386-mingw32]
Hello,
Looking at the source for Net::HTTP#request_get it says that if you pass in a block it will not read the body unless you call #read_body on the response. But when I pass in a block it seems that it reads the when the block exits, even though I did not call #read_body on the request. Consider this example:
url = "http://download.microsoft.com/download/1/6/5/165b076b-aaa9-443d-84f0-73cf11fdcdf8/WindowsXP-KB835935-SP2-ENU.exe"
uri = URI(url)
http = Net::HTTP.new(uri.hostname, uri.port)
http.request_get(uri.request_uri) do |req|
puts req["content-length"]
end # Program stops here for a long time - it must be downloading the body of the file?
compared to this:
http.request_get(uri.request_uri) do |req|
puts req["content-length"]
break # Now this method works as expected, it exits at this point without any delay
end
--
http://bugs.ruby-lang.org/