> I see, so if I disable PARTIAL_WRITES, will that mean that it will return
> values as I wrote up there?

PARTIAL_WRITES has no effect on the meaning of the return value. It just
controls whether or not the internal write logic tries to continue writing
if the underlying write partially completes. With or without PARTIAL_WRITES
enabled, if the socket buffer and internal SSL buffers get full after some
of the data has been accepted, you will get a partial write if the socket is
non-blocking.

> Otherwise I fail to see the difference between allowin partial
> writes and not.

The difference for a non-blocking socket, is that with PARTIAL_WRITES
disabled, the underlying internal write operation will be retried until it
is unable to accept any bytes at all. With PARTIAL_WRITES enabled, only one
call to the underlying internal write operation will be made.

> Furthermore, that would mean that I should actually call
> SSL_write with new
> arguments on the same packet.

I don't know what you mean by "the same packet". Packets are below the TCP
level and have no meaning at or above the TCP level.

> SSL_write(ssl,  buffer + written, len - written);
>
> or am I being retarded here ?

If a previous SSL_write has successfully queued some bytes for sending, you
don't want to send those same bytes again. In any non-blocking socket
application, you have to handle partial writes (a form of *success*) by
saving the rest of the data for when your next write attempt.

DS


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

Reply via email to