Howard Chu wrote: >Hallvard Breien Furuseth wrote: >> When is it safe to leave sc_writewait uninitialized? The field >> seems to have emerged in the middle of RE24, and I don't see any >> flags which say it should/should not be used. > > Where would such flags reside?
slap_callback.sc_flags. If it existed it could get a "the sc_writewait field is valid" bit. Then the struct could have been safely extended without breaking other modules - provided they were recompiled, anyway. >> Since not setting it crashed back-relay in ITS#8428, does that >> mean everything which creates a slap_callback should set it? > > Yes. Then most callback code in slapd must be fixed. Now I don't understand why slapd still works as well as it does... Instead of sc_flags, maybe we should add a word 'sc_signature' for now: back-mdb must set it to a particular value which indicates that sc_writewait is valid, and it must be cleared before freeing the callback. That way modules which don't know about sc_writewait _usually_ won't break, though the signature can be right once in a while. -- Hallvard