[389-devel] Please review: Bug 526319 - SASL IO sometimes loops with "error: would block"

Rich Megginson rmeggins at redhat.com
Tue Sep 29 21:52:22 UTC 2009


    https://bugzilla.redhat.com/show_bug.cgi?id=526319
    Resolves: bug 526319
    Bug Description: SASL IO sometimes loops with "error: would block"
    Reviewed by: ???
    Fix Description: The semantics for recv() are that it returns -1 for 
errors,
 0 for connection closed, and non-zero for some bytes received.  The 
sasl code w
as not using those semantics - it was returning 0 for successful read 
and -1 for
 error.  Although I have not been able to reproduce the exact failure, 
what I be
lieve is happening is that the initial read of the packet length in 
sasl_io_star
t_packet() works, and the sasl IO is received.  At some point, the 
connection is
    closed by the client, and the PR_Recv return of 0 is not handled 
correctly,
and somehow the errno gets set to EWOULDBLOCK.  From this point on, 
PR_Recv() wi
ll return -1 (since the socket has been closed) and errno is not reset 
from EWOU
LDBLOCK.
    The fix is to make sure the sasl IO code handles the PR_Recv() 
return value
    correctly.
    Note that with CONNS (8) error log level, you may still occasionally 
see "wo
uld block" errors, but as long as they are not endlessly repeating, this 
should
    be ok.
    Platforms tested: RHEL5 x86_64
    Flag Day: no
    Doc impact: no
https://bugzilla.redhat.com/attachment.cgi?id=363058&action=diff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3258 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/fedora-directory-devel/attachments/20090929/81cb36e9/attachment.bin>


More information about the Fedora-directory-devel mailing list