> > not send the second request until you have received the entire first
> > reply.
> yes you are right but the indication for "nothing else to read"
> is invalid.
Where are you getting this indication from? If your answer is anything other
than "my HTTP implementation", then you are confused. Only your HTTP
implementation can tell if there is anything to read or not.
> SSL_pending(...) is zero after the first portion
> therefor nothing else to read and then loop stops
The loop should not stop until you receive the entire reply. Your loop logic
is broken.
You should only exit the loop if three things are true:
1) You receive the entire reply. This is not the case, as you have
explained.
2) You receive an error indication. This is not the case, as you have
explained.
3) You are pipelining, and don't mind receiving all or part of the first
reply after you sent the first request. This seems to be a problem for you,
so this is not what you want.
So why are you exiting your loop?!
> And when I try something like that
> r = SSL_read(......)
> if ( r > 0 ) { save data , stay in loop }
> else
> stop loop
>
> this cause r = SSL_read(......) to block for ever.
Right. This is broken. You have to exit the loop when you receive the entire
reply.
> I also can parse response and find "Content-Length: 7967"
> I would get 7195 bytes and try one more r = SSL_read(......)
> and it block for ever. I tried it.
Then troubleshoot *THAT* code. As I explained earlier, you are making dozens
of changes to try to fix a problem and as a result you are adding more and
more problems.
> I do not get "SSL_ERROR_WANT_READ" error
> that is the indication for "there is more data read once more".
Right, you won't get that.
> I only use the HTTP header string
> GET /global/v3/BFGlobalService HTTP/1.1
> Host: api.betfair.com:443
> Content-Type: text/xml; charset=UTF-8
> Content-Length: 609
> SOAPAction: "getActiveEventTypes"
> empty line
> 609 bytes
> Perhabs I have to add something like
> "Allow SEND ALL DATA AT ONCE"
No. You need to follow the HTTP 1.1 specification and keep calling SSL_read
until you either get an error or the entire reply. You said when you try to
do this, SSL_read blocks forever -- so that's the case you need to
troubleshoot.
Most likely, you are incorrectly computing the number of bytes of reply you
have gotten and so are calling SSL_read when you should not. But don't make
it worse by exiting the loop before you have a complete reply -- that will
definitely not work.
DS
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]