On Mon, May 07, 2001 at 04:25:10PM -0400, Tom Biggs wrote:
> Say an application uses SSL_write() to write out (on a non-blocking socket)
> a large buffer, which contains more bytes than an underlying SSL record can 
> carry.
> What is the behavior if, for example, one SSL record is successfully written,
> but EWOULDBLOCK is returned when OpenSSL tries to write the next SSL record?
> What value would be returned by SSL_write()?  Would it be
> A: the number of bytes which were transmitted, or
> B: -1 to indicate a failure?

1. I would also recommend Eric Rescorla's book, as the other poster did,
   as a good book about the SSL/TLS protocol and implementations.
2. Having this said: unlike write() SSL_write() will only return with
   "success", when the complete buffer was written. Partial writes are
   not supported. Thus for the scenario you describe, option "B"
   applies.

> Or, if case 'B' is true, does that imply that the OpenSSL library tracks 
> how many
> bytes have been written and keeps an offset pointer into 'buf' so that it 
> knows
> where to start the next write?

Yes. It keeps the necessary information internally (whether by an
absolute pointer or an offset pointer I don't know without looking
into the source).

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]

Reply via email to