On Tue, May 28, 2002 at 12:56:56PM -0700, Daryl Odnert wrote:
> I understand your answer with respect to SSL_ERROR_WANT_WRITE.
> But I'm not sure I understand the SSL_ERROR_WANT_READ
> scenario.

The state WANT_READ in case of SSL_write() will only occur during
a renegotiation.

> How does one implement a protocol "lock step" protocol
> on top of OpenSSL?  In other words, how do you handle an
> application protocol in which the server will not send any
> response until the client sends a complete command?
> 
> HTTP is an example of such a protocol.  Suppose a browser
> is ready to pass its completel "GET" command to SSL_write().
> How can you ensure that SSL_ERROR_WANT_READ does not happen
> because the client has nothing further to write into the
> SSL context at that point.

Don't misinterprete the manual page. You have to call SSL_write()
again, regardless whether WANT_READ or WANT_WRITE was returned.
You have to repeat the _same_ function call, until success is reached.
Only then you switch to SSL_read() and continue in your normal higher
level protocol, e.g. HTTP.

Best regards,
        Lutz
-- 
Lutz Jaenicke                             [EMAIL PROTECTED]
http://www.aet.TU-Cottbus.DE/personen/jaenicke/
BTU Cottbus, Allgemeine Elektrotechnik
Universitaetsplatz 3-4, D-03044 Cottbus
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to