help-gnutls
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Joe Shaw
Subject: [Help-gnutls] gnutls_bye(), return values, and looping
Date: Fri, 30 Jan 2004 13:44:28 -0500

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.

Searching through google and the GnuTLS docs, it looks like most uses of
gnutls_bye() ignore the return value, even if it's INTERRUPTED or AGAIN
and immediately closes the fd after that.  What is the correct way?

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.

Thanks,
Joe





reply via email to

[Prev in Thread] Current Thread [Next in Thread]