JuliaWeb / GnuTLS.jl

Transport Level Security for Julia Streams provided by GnuTLS
Other
8 stars 13 forks source link

readavailable using takebuf_array vs. takebuf_string #22

Closed slundberg closed 9 years ago

slundberg commented 10 years ago

The standard readavailable() function in base Julia uses takebuf_string() and so returns a string, however the readavailable() in GnuTLS uses takebuf_array and so returns an array of Uint8 values. This can be a bit confusing, especially since readall() returns a string in both base julia and GnuTLS.

Not sure if this was an intentional choice, but I wanted to mention it since it took a few minutes to figure why a switching readall() to readavailable() in the given GnuTLS example didn't won't like I expected. Thanks for the great package!

Keno commented 10 years ago

Frankly I think the base julia version should also return a bytearray (maybe so should readall).

slundberg commented 10 years ago

Ah. Well I don't have any opinion about which is best, but it would be nice to have them consistent eventually.

sbromberger commented 9 years ago

Just to follow up - perhaps this was not the way you wanted things to go, but readall() now mimics readavailable() in that it returns an array of UInt8.

sbromberger commented 9 years ago

I'll close this out for now (trying to tidy up some old issues) - but please feel free to open a new issue if you'd still like to discuss. Thanks.