Bingo!
Gabor Gombas
gombasg at sztaki.hu
Sat Nov 17 08:34:02 EST 2007
On Fri, Nov 16, 2007 at 11:17:23PM +0100, Sebastian Hagedorn wrote:
> I haven't yet found what BIO stands for According to Wikipedia it's "an
> abstraction library used by OpenSSL to handle communication of various
> kinds, including files and sockets, both secure and not".
You can think about a BIO as an object that wraps around a file (socket)
descriptor, has an internal buffer and some methods for reading and
writing. I.e. instead of calling the read() syscall on the socket, you
call the ->read method of the BIO, and that ->read method may do
whatever it wants including decrypting the raw SSL stream.
Of course this description is not entirely correct but is enough to give
you the idea.
> I'm not sure what to make of that. I would assume that we've got a blocking
> BIO, because it is - d'oh - blocking. But I don't see how you influence
> what kind of BIO you use.
A BIO is non-blocking if the underlying file (socket) descriptor has the
O_NONBLOCK flag set, either during open or by a previous call to
fcntl().
And yes, if O_NONBLOCK was not set on a socket, then any OpenSSL
operations can block pretty much indefinitely.
Gabor
--
---------------------------------------------------------
MTA SZTAKI Computer and Automation Research Institute
Hungarian Academy of Sciences
---------------------------------------------------------
More information about the Info-cyrus
mailing list