Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 26th, 2012  |  syntax: None  |  size: 1.30 KB  |  hits: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ruby httpclient gem very slow at downloading file
  2. HTTPClient.new.get_content(url) do |chunk|
  3.   puts "Downloaded chunk of size #{chunk.size}"
  4.   file.write(chunk)
  5. end
  6.        
  7. Downloaded chunk of size 12276
  8. Downloaded chunk of size 4108
  9. Downloaded chunk of size 12276
  10. Downloaded chunk of size 4108
  11. Downloaded chunk of size 12276
  12. Downloaded chunk of size 4108
  13. Downloaded chunk of size 12276
  14. Downloaded chunk of size 4108
  15. Downloaded chunk of size 12276
  16.        
  17. Zlib::StreamError: stream error: invalid window bits
  18.     from /Users/<user>/.rvm/gems/jruby-1.6.2@share/gems/httpclient-2.2.0.2/lib/httpclient/session.rb:652:in `get_body'
  19.     from /Users/<user>/.rvm/gems/jruby-1.6.2@share/gems/httpclient-2.2.0.2/lib/httpclient.rb:1062:in `do_get_block'
  20.     from /Users/<user>/.rvm/gems/jruby-1.6.2@share/gems/httpclient-2.2.0.2/lib/httpclient.rb:866:in `do_request'
  21.     from /Users/<user>/.rvm/gems/jruby-1.6.2@share/gems/httpclient-2.2.0.2/lib/httpclient.rb:953:in `protect_keep_alive_disconnected'
  22.     from /Users/<user>/.rvm/gems/jruby-1.6.2@share/gems/httpclient-2.2.0.2/lib/httpclient.rb:865:in `do_request'
  23.     from /Users/<user>/.rvm/gems/jruby-1.6.2@share/gems/httpclient-2.2.0.2/lib/httpclient.rb:938:in `follow_redirect'
  24.     from /Users/<user>/.rvm/gems/jruby-1.6.2@share/gems/httpclient-2.2.0.2/lib/httpclient.rb:577:in `get_content'