> Can anyone look at them and tell me what's wrong
> with them?  My SSL connections are working, but the reading is never able to
> detect when a peer has closed the other end of the connection.  
> 
> 
> int sslsocket::getch(char& ch)
> {
>  if(m_init)
>   init();
> 
>  int ret = SSL_read(m_ssl, &ch, 1);
> 
>  if(ret < 0)
>  {
>    return 0;

     ^^^^^^^^^
What's that for?


>   if(ERR_get_error())
>   {
>    close();
>    return CLOSED;
>   }
>   else
>    return 0;
>  }
>  else if(ret == 0)
>   return 0;
> 
>  return 1;
> }
> 

With that line of code in there, you are never actually going to check
for a CLOSED condition.

Steven


-- 
==================================================================
== Steven M. Cherry                       [EMAIL PROTECTED]  ==
==                       http://216.59.115.58/steven/home.html  ==
==================================================================
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to