Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
malmaud committed Aug 31, 2015
1 parent 4a4c6ed commit a161f26
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/GnuTLS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -275,17 +275,18 @@ end

function read_ptr(strm_ref,ptr::Ptr{Uint8},size::Csize_t)
io = unsafe_pointer_to_objref(strm_ref)
@show io, ptr, size
Base.wait_readnb(io,1)
n = min(nb_available(io.buffer),size)
@compat read!(io,pointer_to_array(ptr,Int(n)))
@show n = min(nb_available(io.buffer),size)
@show @compat read!(io,pointer_to_array(ptr,Int(n)))
ret = convert(Cssize_t,n)
ret::Cssize_t
end

function write_ptr(strm_ref,ptr::Ptr{Uint8},size::Csize_t)
io = unsafe_pointer_to_objref(strm_ref)
@show io, ptr, size
ret = convert(Cssize_t, Base.write(io, ptr, size))
@show ret = convert(Cssize_t, Base.write(io, ptr, size))
ret::Cssize_t
end

Expand Down

0 comments on commit a161f26

Please sign in to comment.