1
0
Эх сурвалжийг харах

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))
Nathan Kinder 14 жил өмнө
parent
commit
b41338f9d2

+ 1 - 1
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),