From: Justin Bailey Date: 2007-04-14T00:55:03+09:00 Subject: Testing net/http changes in ruby 1.9 and having trouble on Windows ------=_Part_8450_28931409.1176479700629 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I have managed to build Ruby 1.9 on my windows machine, but Net::HTTP calls just hang. Here's my test script: require 'net/http' puts "Ruby version: #{RUBY_VERSION}" puts "opening local site" Net::HTTP.start("localhost", "8808") do |http| puts "in block" puts "Got response with length: #{http.get("/").body.length}" end puts "opening remote" proxy = URI.parse(ENV["http_proxy"]) Net::HTTP.Proxy(proxy.host, proxy.port).start("www.google.com") do |http| puts "in block" puts "Got (proxy) response with length: #{ http.get("/").body.length}" end Under 1.8.5, I get this output: >ruby test.rb Ruby version: 1.8.5 opening local site in block Got response with length: 19575 opening remote in block Got (proxy) response with length: 4156 But under 1.9, it hangs: >ruby19 test.rb Ruby version: 1.9.0 opening local site ^C Does anybody have a suggestion for what might be going on? Thanks! ------=_Part_8450_28931409.1176479700629 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I have managed to build Ruby 1.9 on my windows machine, but Net::HTTP calls just hang. Here's my test script:

require 'net/http'

puts "Ruby version: #{RUBY_VERSION}"
puts "opening local site"
Net::HTTP.start("localhost", "8808") do |http|
  puts "in block"
  puts "Got response with length: #{http.get("/").body.length}"
end

puts "opening remote"

proxy = URI.parse(ENV["http_proxy"])
Net::HTTP.Proxy(proxy.host, proxy.port).start("www.google.com ") do |http|
    puts "in block"
    puts "Got (proxy) response with length: #{ http.get("/").body.length}"
end

Under 1.8.5, I get this output:


>ruby test.rb
Ruby version: 1.8.5
opening local site
in block
Got response with length: 19575
opening remote
in block
Got (proxy) response with length: 4156

But under 1.9, it hangs:

>ruby19 test.rb
Ruby version: 1.9.0
opening local site
^C

Does anybody have a suggestion for what might be going on? Thanks! ------=_Part_8450_28931409.1176479700629--