Skip to content

Instantly share code, notes, and snippets.

@RyanScottLewis
Created August 8, 2011 21:25
Show Gist options
  • Save RyanScottLewis/1132791 to your computer and use it in GitHub Desktop.
Save RyanScottLewis/1132791 to your computer and use it in GitHub Desktop.
read_nonblock_ruby_19.rb
# This fix is needed to preform GET/POST/PUT/DELETE requests to HTTPS
if RUBY_ENGINE == "jruby" && RUBY_VERSION == "1.9.2"
Net::BufferedIO.class_eval do
BUFSIZE = 1024 * 16
def rbuf_fill
timeout(@read_timeout) do
@rbuf << @io.sysread(BUFSIZE)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment