reinstated the legacy UDP#write for jruby, because there's no sendmsg_nonblock

This commit is contained in:
HoneyryderChuck 2021-04-01 19:59:39 +01:00
parent 6e4ce5a638
commit 53b894170d
2 changed files with 9 additions and 0 deletions

View File

@ -84,6 +84,14 @@ module HTTPX
rescue IOError
end
end
# In JRuby, sendmsg_nonblock is not implemented
def write(buffer)
siz = @io.send(buffer.to_s, 0, @host, @port)
log { "WRITE: #{siz} bytes..." }
buffer.shift!(siz)
siz
end if RUBY_ENGINE == "jruby"
# :nocov:
end
end

View File

@ -150,6 +150,7 @@ module HTTPX
end
def load_dependencies(klass)
require "digest/sha2"
require "openssl"
klass.plugin(:expect)
klass.plugin(:compression)