I too faced similar problem when I pumped heavy data via smart
bits..
this piece of code worked for me..btw the underlying bio in non
blocking..
do
{
ERR_clear_error();
nbytesread = SSL_read(pSSLObject,pBuffer,BufSize);
if(nbytesread > 0 )
{
totalbytesread += nbytesread;
pBuffer = pBuffer + nbytesread;
BufSize -= nbytesread;
}
if(errno == EAGAIN || errno == EINTR || errno == ENOMEM)
{
return (SSL_ERROR_NONE);
}
else if(!nbytesread)
{
return (-1 * SSL_ERROR_ZERO_RETURN);
}
else
{
err = SSL_get_error(pSSLObject,nbytesread);
break;
}
}while(SSL_pending(pSSLObject) && (BufSize > 0));
{
ERR_clear_error();
nbytesread = SSL_read(pSSLObject,pBuffer,BufSize);
if(nbytesread > 0 )
{
totalbytesread += nbytesread;
pBuffer = pBuffer + nbytesread;
BufSize -= nbytesread;
}
if(errno == EAGAIN || errno == EINTR || errno == ENOMEM)
{
return (SSL_ERROR_NONE);
}
else if(!nbytesread)
{
return (-1 * SSL_ERROR_ZERO_RETURN);
}
else
{
err = SSL_get_error(pSSLObject,nbytesread);
break;
}
}while(SSL_pending(pSSLObject) && (BufSize > 0));
-----Original Message-----Hi,
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Haridharan Nattamai
Sent: Wednesday, April 19, 2006 6:59 PM
To: openssl-users@openssl.org
Subject: errno=5 in SSL_read( )
I'm using openssl v0.9.7i. When I try to receive a huge amount of data sometimes I get errno=5(SSL_ERROR_SYSCALL) and the exact response code is "EOF was observed that violates the protocol". At some cases when this error occurs, I get TCP ZeroWindowViolation in ethereal's trace log. I like to know what could be the reason and how can I override this.
Thanks in advance.
Haridharan