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                    [email protected]
Automated List Manager                           [email protected]

Reply via email to