Re: When must slap_callback.sc_writewait be set?

2016-05-19 Thread Howard Chu

Hallvard Breien Furuseth wrote:

I wrote:

Oh, right... New problem, though: If a a third-party module sets
sc_private in such an initializer, that now sets sc_writewait instead.


I mean, and old module which predates sc_writewait.

Hm yeah, I suppose we could just move sc_writewait to the end of the struct. 
Probably should have done that in the first place.


--
  -- Howard Chu
  CTO, Symas Corp.   http://www.symas.com
  Director, Highland Sun http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/



Re: When must slap_callback.sc_writewait be set?

2016-05-19 Thread Hallvard Breien Furuseth
I wrote:
> Oh, right... New problem, though: If a a third-party module sets
> sc_private in such an initializer, that now sets sc_writewait instead.

I mean, and old module which predates sc_writewait.

-- 
Hallvard



Re: When must slap_callback.sc_writewait be set?

2016-05-19 Thread Howard Chu

Hallvard Breien Furuseth wrote:

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...


Because most callback users do a default initialization, e.g.
slap_callback cb = { xx };

back-relay was odd in this respect.

--
  -- Howard Chu
  CTO, Symas Corp.   http://www.symas.com
  Director, Highland Sun http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/



Re: When must slap_callback.sc_writewait be set?

2016-05-19 Thread Howard Chu

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?


Since not setting it crashed back-relay in ITS#8428, does that
mean everything which creates a slap_callback should set it?


Yes.


Seems unfortunate for third-party modules...

Also, I think this should be documented.



--
  -- Howard Chu
  CTO, Symas Corp.   http://www.symas.com
  Director, Highland Sun http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/



When must slap_callback.sc_writewait be set?

2016-05-19 Thread Hallvard Breien Furuseth
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.

Since not setting it crashed back-relay in ITS#8428, does that
mean everything which creates a slap_callback should set it?
Seems unfortunate for third-party modules...

Also, I think this should be documented.

-- 
Hallvard