Hi,

I'm encountering a problem with SSL_write when writing a large amount of
data (about 1Mb) using non-blocking sockets.

For smaller amounts of data (about 1kb), the return code (bytes written)
what you would expect.

For the larger amount of data, the return code is -1.  When checking
SSL_get_error() the result is SSL_ERROR_NONE (0).  If I then repeat the
write, as if the result want SSL_WANT_READ or SSL_WANT_WRITE, then the
behaviour just repeats itself.

There is no apparent explanation in the man pages to SSL_write of what
action to take if the bytes written is -1, but SSL_get_error() returns 0.

Then I considered that I might want to implement partial writing.  So I
changed the code to add:

(void)SSL_CTX_set_mode(sslContextP, SSL_MODE_ENABLE_PARTIAL_WRITE);

... and then the behaviour does change.  Now the bytes written returns a
block of data (16384 bytes), until I have written about 300k, when the same
behaviour above occurs.

Can anybody enlighten me on how to handle this combination.

Using blocking sockets, there was no problem.

Thanks,

G.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to