On Thu, Feb 26, 2009 at 2:14 AM, Tanaka Akira <akr / fsij.org> wrote:

> Does it care the I/O buffer implemented in
> ext/openssl/lib/openssl/buffering.rb ?
>

I'm not certain.  What exactly does this do?


> What's happen if nonblocking methods and blocking methods are used both?
>

This (monkey) patch uses the core nonblocking functionality of OpenSSL, so
it should be possible to use blocking and nonblocking methods
interchangably.


> Note that IO#read_nonblock reads from IO buffer if it is not empty.
>  IO#write_nonblock flushes IO buffer.
>
> See read_nonblock implementation in
> ext/openssl/lib/openssl/buffering.rb in ruby-1.9.2dev.
>

What is the present behavior if IO#read_nonblock is called when the socket
needs writable to continue?  How are cases like SSL renegotiation presently
handled?

Different classes makes OpenSSL nonblocking methods and
> IO/Socket nonblocking methods incompatible.
>

Yes, unfortunately the concerns of nonblocking SSL are different than they
are from a standard socket.  Standard nonblocking sockets never expect the
socket need be ready for an I/O operation which wasn't requested.
Unfortunately the requirements of SSL necessitate waiting on readability or
writability regardless of which operation was requested.  The socket may
need to be writable in a case where read_nonblock was requested, and vice
versa.


> I think Errno::EWOULDBLOCK object extended by some module,
> IO::WandRead or IO::WantWrite, is better.
>

I can certainly use those exceptions instead.

-- 
Tony Arcieri
medioh.com