[Help-gnutls] gnutls_bye(), return values, and looping

Nikos Mavroyanopoulos nmav at gnutls.org
Sun Feb 1 21:09:25 CET 2004


Quoting Joe Shaw <joe at ximian.com>:

> Hi,
> 
> I am a little confused about how exactly to handle the return values
> from gnutls_bye().  I have some code which does the following:
> 
>         do {
>         	ret = gnutls_bye (chan->session, GNUTLS_SHUT_RDWR);
>         } while (ret == GNUTLS_E_INTERRUPTED ||
>         	 ret == GNUTLS_E_AGAIN);
>         
> In almost every case, this works out just fine, and I can close the file
> descriptor after that.
> I'm running into a problem on one of our test machines, though, that
> gnutls_bye() always returns GNUTLS_E_AGAIN, causing an infinite loop and
> using 100% CPU.
[...]
> Perhaps more importantly, is there any steadfast reason why it'd always
> return AGAIN?  Could it be a bug in GnuTLS that removing my do-while
> would really just be papering over?  Any info would be helpful.

GNUTLS_E_AGAIN is returned because the underlying layer (recv or send)
returned EAGAIN. gnutls does not use this error value.

> Thanks,
> Joe


-- 
nmav at gnutls.org





More information about the Gnutls-help mailing list