I compiled and ran demos/bio/sconnect.c.  In this I found a problem with 
BIO_should_retry().

This is the code that doesn't work like it should:
for (;;)
        {
        i=BIO_write(out,&(p[off]),len);
        if (i <= 0)
                {
                if (BIO_should_retry(out))
                        {
                        fprintf(stderr,"write DELAY\n");
                        sleep(1);
                        continue;
                        }
                else
                        {
                        goto err;
                        }
                }
        off+=i;
        len-=i;
        if (len <= 0) break;
        }

Under Win32 when BIO_write() is first called it returns -1 and the BIO_should_rety() 
returns 8. The next time it is called (after
the 1 second sleep) BIO_write() again returns -1 but this time BIO_should_retry() 
returns 0!  It does this for a few seconds before
starting to return 8 again.

Under UNIX BIO_should_retry() returns 8 the entire time until the data is successfully 
sent.

I've been working around it by just ignoring the BIO_should_retry() for now, but 
obviously this is a problem since it doesn't catch
real errors. I'm very new with this code and I got lost tracking down this bug.  Can 
somebody help out with it?

This was a PITA to track down since all my code was working on my local LAN and only 
started failing when connecting to the internet
(I assume the connection is established on the first call on the LAN).

Regards,
Rick Wagner

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

Reply via email to