[Date Prev][Date Next]
(ITS#6739) broken do_syncrep2()
Full_Name: Hallvard B Furuseth
Submission from: (NULL) (126.96.36.199)
Submitted by: hallvard
slapd/syncrepl.c:do_syncrep2() initializes many variables once which
should have been initialized inside the loop.
I'll add the initializations I can figure out, and move most variables
into the loop for readability.
Variables 'm' and 'refreshDeletes' may still be wrong. In particular
'm'. It "feels" like it should be local to the loop, but there's no
logic that I can see to prevent previous value from being used.
Perhaps they depend on the peer not breaking the sync protocol?
I haven't read that myself, I'm just peering at the code.
I've added three somewhat arbitrary bits of code for error handling:
- A Debug() statement on line 847 which can likely be improved.
- Set err and rc to LDAP_OTHER on ldap_parse_result/ldap_get_option
failure. The correct fix would be proper error checks (ITS#6738),
but I don't know what to do on error.