@@ -398,6 +398,7 @@ mutable struct SSLStream <: IO
398398 wbio:: BIO
399399 io:: TCPSocket
400400 lock:: ReentrantLock
401+ readbytes:: Base.RefValue{Csize_t}
401402@static if VERSION < v " 1.7"
402403 close_notify_received:: Threads.Atomic{Bool}
403404 closed:: Threads.Atomic{Bool}
413414 ssl = SSL (ssl_context, bio_read, bio_write)
414415
415416@static if VERSION < v " 1.7"
416- return new (ssl, ssl_context, bio_read, bio_write, io, ReentrantLock (), Threads. Atomic {Bool} (false ), Threads. Atomic {Bool} (false ))
417+ return new (ssl, ssl_context, bio_read, bio_write, io, ReentrantLock (), Ref {Csize_t} ( 0 ), Threads. Atomic {Bool} (false ), Threads. Atomic {Bool} (false ))
417418else
418- return new (ssl, ssl_context, bio_read, bio_write, io, ReentrantLock (), false , false )
419+ return new (ssl, ssl_context, bio_read, bio_write, io, ReentrantLock (), Ref {Csize_t} ( 0 ), false , false )
419420end
420421 end
421422end
@@ -534,7 +535,7 @@ function Base.unsafe_read(ssl::SSLStream, buf::Ptr{UInt8}, nbytes::UInt)
534535 nread = 0
535536 while nread < nbytes
536537 (! isopen (ssl) || eof (ssl)) && throw (EOFError ())
537- readbytes = Ref {Csize_t} ()
538+ readbytes = ssl . readbytes
538539 @geterror ccall (
539540 (:SSL_read_ex , libssl),
540541 Cint,
0 commit comments