On Fri, 15 May 1998, Christian Starkjohann wrote:
> this must be a frequently requested feature, but I have not found much about
> it in the archives. The basic functionality of SSL should be implementable
> with the following simple interface structure:
...
> With this structure, the flow control is governed by the transport layer,
> not by the application. This is usually what is desired.
>
> The usual socket interface is the other way around: The application layer
> calls the transport layer. This creates all kinds of problems with blocking
> vs. non-blocking I/O etc.
>
> Now my question: is such an interface available in SSLeay?
Funny you should ask :-).
Basically you have descibed the non-blocking model so popular in Winsock :-).
The way SSLeay supports this interface is that any call to SSL_read/SSL_write,
if it would block, returns -1 and a call can determine if it was a 'no data'
available situation.
The application has to determine when to call SSL_read/SSL_write.
It is a little ugly, but at least the event driven model can be implemented on
this but it is hard to do the reverse.
Anyway, the application, when notified that there is data available on the
transport layer, can call SSL_read() and then, depending on the returned
value, know what condition it needs to contiune the 'stream'.
A long time ago there was something called the 'EIO' API which implemented
this event driven API under windows/unix/macOS etc. It was a 'register
callback' for a specific set of socket conditions. The callback then could
call the relevenet SSL_Read/SSL_write and then, depending on the results,
re-register its self for a different set of conditions. This sort of stuff is
not hard to write but was deemed outside the scope of SSLeay (as a
protocol/crypto libarary).
eric
+-------------------------------------------------------------------------+
| Administrative requests should be sent to [EMAIL PROTECTED] |
| List service provided by Open Software Associates, http://www.osa.com/ |
+-------------------------------------------------------------------------+