ldap/servers/plugins/replication/repl5_connection.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit b41338f9d2417f867a2a775848f9edf42f288a82
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Mar 22 13:49:35 2011 -0700
Bug 689952 - (cov#10581) Incorrect bit check in replication connection code
In the replication connection code, we do a bit check that is incorrect.
We currently have this in repl5_connection.c at line 540:
} else if ((rc < 0) || ((polldesc.out_flags|PR_POLL_WRITE) == 0)) {
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
...
The problem is that "((polldesc.out_flags|PR_POLL_WRITE) == 0))" will
always be false since PR_POLL_WRITE is defined as 2. We should be using
the following condition instead to check if out_flags does not have
PR_POLL_WRITE set:
(!(polldesc.out_flags&PR_POLL_WRITE))
diff --git a/ldap/servers/plugins/replication/repl5_connection.c
b/ldap/servers/plugins/replication/repl5_connection.c
index 47850b3..068f1f4 100644
--- a/ldap/servers/plugins/replication/repl5_connection.c
+++ b/ldap/servers/plugins/replication/repl5_connection.c
@@ -537,7 +537,7 @@ see_if_write_available(Repl_Connection *conn, PRIntervalTime timeout)
agmt_get_long_name(conn->agmt),
timeout);
return CONN_TIMEOUT;
- } else if ((rc < 0) || ((polldesc.out_flags|PR_POLL_WRITE) == 0)) { /* error */
+ } else if ((rc < 0) || (!(polldesc.out_flags&PR_POLL_WRITE))) { /* error */
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
"%s: error during poll attempt [%d:%s]\n",
agmt_get_long_name(conn->agmt),
Show replies by date