On Sat, Apr 14, 2007 at 02:02:25PM -0700, David Schwartz wrote:
> I also think building it around 'poll' makes the most sense. The application
> should have a way to add its own file descriptors to the poll sets before
> blocking in 'poll'.

I see two immediately obvious ways to do this. The existing prototype for
poll() is:

int poll(struct pollfd *fds, nfds_t nfds, int timeout);

struct pollfd {
int fd; /* file descriptor */
short events; /* events to look for */
short revents; /* events returned */

Now, you can either do this:

int SSL_poll(struct SSL_pollfd *sfds, nfds_t nfds, int timeout)

struct SSL_pollfd {
int type; /* SSL_CTX or fd */
union eventu {
int fd;
SSL_CTX *sctx;
short events;
short revents;

Or this:

int SSL_poll(struct pollfd *fds, nfds_t nfds, int timeout,
struct SSL_pollctx *sctx, nfds_t nsctx);

I think the second is considerably cleaner in practice,
counterintuitive as that may seem, since it requires application
authors merely to add new arguments to the end of existing
calls to poll() to get started using the interface, and
lends itself to a quick implementation that just #defines away
to plain poll() until work is done to really implement waiting
on cryptographic operations down in the guts of the library.

Both of these, I should note, are impossible to implement on
systems which have only select(). :-/

__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-dev@openssl.org
Automated List Manager majordomo@openssl.org