class OpenSSL::GETS_BIO

Defined in:

openssl_ext/bio/bio.cr

Constant Summary

GETS_BIO = begin crystal_bio = OpenSSL::BIO::CRYSTAL_BIO bgets = LibCrypto::BioMethodGets.new do |bio, buffer, len| io = Box(IO).unbox(BIO.get_data(bio)) io.flush position = io.pos line = io.gets(len, false) if line.nil? 0 else io.seek(position) bytes = (io.read(Slice.new(buffer, line.bytesize))).to_i if bytes == 1 else bytes = bytes - 1 end bytes end end {% if (compare_versions(LibCrypto::OPENSSL_VERSION, "1.1.0")) >= 0 %} LibCrypto.BIO_meth_set_gets(crystal_bio, bgets) {% else %} crystal_bio.value.bgets = bgets {% end %} crystal_bio end

Constructors

Instance Method Summary

Constructor Detail

def self.new(io : IO) #

[View source]

Instance Method Detail

def finalize #

[View source]
def io : IO #

[View source]
def to_unsafe : Pointer(LibCrypto::Bio) #

[View source]