<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 09/29/2009 02:52 PM, Rich Megginson wrote:
<blockquote cite="mid:4AC28196.8040301@redhat.com" type="cite">  
<a class="moz-txt-link-freetext" href="https://bugzilla.redhat.com/show_bug.cgi?id=526319">https://bugzilla.redhat.com/show_bug.cgi?id=526319</a>
  <br>
   Resolves: bug 526319
  <br>
   Bug Description: SASL IO sometimes loops with "error: would block"
  <br>
   Reviewed by: ???
  <br>
   Fix Description: The semantics for recv() are that it returns -1 for
errors,
  <br>
0 for connection closed, and non-zero for some bytes received.  The
sasl code w
  <br>
as not using those semantics - it was returning 0 for successful read
and -1 for
  <br>
error.  Although I have not been able to reproduce the exact failure,
what I be
  <br>
lieve is happening is that the initial read of the packet length in
sasl_io_star
  <br>
t_packet() works, and the sasl IO is received.  At some point, the
connection is
  <br>
   closed by the client, and the PR_Recv return of 0 is not handled
correctly,
  <br>
and somehow the errno gets set to EWOULDBLOCK.  From this point on,
PR_Recv() wi
  <br>
ll return -1 (since the socket has been closed) and errno is not reset
from EWOU
  <br>
LDBLOCK.
  <br>
   The fix is to make sure the sasl IO code handles the PR_Recv()
return value
  <br>
   correctly.
  <br>
   Note that with CONNS (8) error log level, you may still occasionally
see "wo
  <br>
uld block" errors, but as long as they are not endlessly repeating,
this should
  <br>
   be ok.
  <br>
   Platforms tested: RHEL5 x86_64
  <br>
   Flag Day: no
  <br>
   Doc impact: no
  <br>
<a class="moz-txt-link-freetext" href="https://bugzilla.redhat.com/attachment.cgi?id=363058&action=diff">https://bugzilla.redhat.com/attachment.cgi?id=363058&action=diff</a>
  <br>
</blockquote>
ack<br>
<blockquote cite="mid:4AC28196.8040301@redhat.com" type="cite">
  <pre wrap="">
<hr size="4" width="90%">
--
389-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:389-devel@redhat.com">389-devel@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/fedora-directory-devel">https://www.redhat.com/mailman/listinfo/fedora-directory-devel</a>
  </pre>
</blockquote>
<br>
</body>
</html>