qt-interest@trolltech.com
[Top] [All Lists]

Re: SSL Troubles

Subject: Re: SSL Troubles
From: "Daniel Verite"
Date: Sun, 23 Oct 2005 23:35:34 +0200
        Dmitry Nezhevenko wrote:

> This code sometimes work.. But sometimes i got problem. "available" is ~2kb 
> but act_available is 0 and ssl_error = 1, sometimes 2 and data is not reads.. 
>  
> Can you help?

The fact that there's 2kb to read from the socket doesn't mean that the SSL
layer can assemble and decode a complete record from that. 
It may need more data.
To let it consume more data, you have to repeatedly call SSL_read()
until it no longer produces the SSL_ERROR_WANT_READ or
SSL_ERROR_WANT_WRITE pseudo-errors.
But read (and re-read) the manpages for the SSL calls: they explain this
as well as other details you really want to know to produce reliable code
in non-blocking mode.

-- 
 Daniel
 PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

--
To unsubscribe - send "unsubscribe" in the body to 
qt-interest-request@xxxxxxxxxxxxx
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>