Thanks for the replys !

Experimently I found that on non-blocking socket when SSL_write is returned with SSL_ERROR_WANT_WRITE, If the same data is not re-inserted then there will be data loses in other side.

So the *****same data should be re-inserted when 'select' detects that socket is writable.*********







David Schwartz wrote:
Nikos Balkanas:

Well, the manual clearly states about looping the SSL_write call.

I have no idea what part of the manual you've misunderstood so badly. If you
give a specific cite, I'll explain precisely what it's trying to say to
correct your misunderstanding. But what you are saying is *completely*
incorrect.

You can
say what you want about it, but i have verified it in practice.

What you have verified is that if you act on your misunderstanding, things
don't work. And you've found some atrocious workarounds for your
misunderstandings. That's great, but other people should simply use the code
correctly and then they won't need atrocious workarounds.

Also it
doesn't say anything about sched_yield, that's something you have
to figure
out on your own.

Rather than figuring out your own way to do things wrong, why not just do
things *right* and then you won't have to figure anything out? Whatever
problem you're having, sched_yield is not the solution for precisely the
reasons I already explained.

You can either loop endlessly around the SSL_write call,
burning up CPU cycles, or relinguish CPU to something more useful. I will
not even try to suggest to you which is more efficient.

What is most efficient is neither of those things. What is most efficient is
to follow the documentation correctly and retry the operation when something
has changed. Both looping endlessly around SSL_write and calling sched_yield
both wind up calling SSL_write many, many times even though nothing has
changed, so *neither* is efficient. No sane person would choose either of
these approaches. They would instead use one of the correct approaches, all
of which are both documented and there are examples of them in the example
apps.

Using sched_yield is your own horribly broken non-solution to a problem
solely of your own making, probably caused by you ignoring the return values
of OpenSSL functions.

Nikos

DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org




*******************************************************************************************************************************************************************

"The information contained in this email including in any attachment is confidential 
and is meant to be read only by the person to whom it is addressed. If you are not the 
intended recipient(s), you are prohibited from printing, forwarding, saving or copying 
this email. If you have received this e-mail in error, please immediately notify the 
sender and delete this e-mail and its attachments from your computer."

*******************************************************************************************************************************************************************

Reply via email to