A non-blocking caller of s2n_negotiate has no way to know whether the socket needs to read or write.
Currently, I think any caller has no choice but to spin calls to s2n_negotiate (though it might reasonably assume that it needs to block on read).
If the value of 'more' was an enum, with WANT_READ or WANT_WRITE, the surrounding event-driven engine will know which event to wait for.
A non-blocking caller of
s2n_negotiatehas no way to know whether the socket needs to read or write.Currently, I think any caller has no choice but to spin calls to
s2n_negotiate(though it might reasonably assume that it needs to block on read).If the value of 'more' was an enum, with
WANT_READorWANT_WRITE, the surrounding event-driven engine will know which event to wait for.