[Help-gnutls] Asynchronous application and not enough buffer ready

cascardo at minaslivre.org cascardo at minaslivre.org
Wed Jun 8 20:46:08 CEST 2005

Well, that was the kind of solution I was looking for. Something that
would not require reading from the socket outside the main loop.

However, the solution proposed has made gnutls_record_recv go into a
loop. It should return with 0 bytes read to the caller. I will check
out the code and see if it's possible. If not, I will have to use some
solutions I didn't want to.

Thanks for the reply.

Thadeu Cascardo.

On Wed, Jun 08, 2005 at 08:15:58PM +0200, Nikos Mavrogiannopoulos wrote:
> On Wednesday 08 June 2005 17:16, cascardo at minaslivre.org wrote:
> > Hello,
> I'm not really sure I've understood the situation, but anyway my comments
> are below.
> > When the record size is greater than what the application has already
> > put in the buffer, gnutls asks for bytes to the pull function which
> > have not yet been read from the socket. To read these bytes, the main
> > loop must run again. 
> Then the pull function should return -1 and set errno to EAGAIN.
> > The pull function returns 0 bytes read twice 
> > after pulling the bytes already read and record_recv returns with an
> > error indicating that a TLS packet of unexpected size has been
> > received.
> This is correct. gnutls cannot decrypt until a full packet has been received.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: </pipermail/attachments/20050608/998e122b/attachment.pgp>

More information about the Gnutls-help mailing list