> Hallo
>
> I made a simple SSL Client on win32
> The request and response works perfectly
> when the amount of data is small enough
>
> I made a request with SSL_write
> Servers answers with "..200 OK ..." etc
>
> SSL_read gives 7159 bytes.
> SSL_get_error  gives allways  SSL_ERROR_NONE
> and therefor the loop stops

This sounds like broken logic. The loop should stop when all the data has
been received. Why are you calling SSL_get_error when there was no error
indication?

> but there are 975 bytes missing.

So why did your loop stop? You need to keep looping until you receive all
the data.

> and when i call SSL_read again it blocks.

I'm not sure exactly what you mean by this. If your loop stopped, why would
you call SSL_read again? Are you combining the results from two different
test runs? Or do you mean something other than the obvious by "the loop
stops".

> My progamm then want to make another request.
> again invoking SSL_write and SSL_read.
>
> Then this SSL_read give the missing 975 bytes.:confused:

Because you didn't read them before, leaving them in the buffer. By why
would your program send a request before it receives the entire reply from
the previous request anyway? Are you intentionally trying to pipeline? If
so, then that's what happens when you pipeline, you sometimes get part of
the reply to the first request after you send the second. If you aren't
pipelining intentionally, why are you sending the second query before you
get the response to the first?

> The request is ignored, i think
>
> What happens here ?

This sounds like a case of a common type of "debugging gone wrong" scenario.
You have a problem, and you change a whole bunch of things to try to fix it.
You add an extra SSL_read call after you think you're done reading. You
don't get the whole reply, so you send the next request anyway, just to keep
going. As a result, after a few iterations you have your original problem
plus all the broken logic to added to try to "work around" it.

Take out all the nonsense and get back to your original problem. Send your
request. Keep calling SSL_read until you either get an error or the entire
reply. Then move onto the next request.

Tell us what goes wrong with that simple case. And don't bastardize it
trying to fix it.

DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to