Duhhh.  Of course, a foolish code error, declaring bytesWritten as size_t
rather than int and comparing with 0.

Thanks for your tolerance.  I'm regularly amazed by the good humour that you
all show to idiot users.

G.

-----Original Message-----
From: Lutz Jaenicke [mailto:[EMAIL PROTECTED]]
Sent: 10 July 2001 21:04
To: '[EMAIL PROTECTED]'
Subject: Re: Return code from SSL_write


On Tue, Jul 10, 2001 at 03:55:24PM +0100, Shaw, George wrote:
> 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.

With all due respect: there must be something wrong with your code.

There is just one place in SSL_get_error(), at which SSL_ERROR_NONE
is returned: in the case "i>0", meaning that the return code was
positive. Are you sure, that your call to SSL_get_error() is correct?

> 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.
Yes, that is because it cannot happen...

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

Reply via email to