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

cascardo at minaslivre.org cascardo at minaslivre.org
Wed Jun 8 17:16:41 CEST 2005


Hello,

First of all, thank for this wonderful software. I'm currently trying
to write some software using libgnet (that uses glib) and gnutls. The
version of gnutls I'm using is 1.0.16.

My application runs a glib loop, waiting for bytes in the TCP
connection. I put them on a buffer, and then calls
gnutls_record_recv. I have set the pull function to one that gets
bytes from that buffer.

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. 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.

Is there any way to solve this without changing the path bytes make
through my application? I have thought of a solution getting the bytes
from the socket in the pull function, but I'd like to keep this in the
main loop. Is that possible?

Regards,
Thadeu Cascardo.
--

-------------- 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/e1562d1b/attachment.pgp>


More information about the Gnutls-help mailing list