register events

Stefan (metze) Metzmacher metze at metzemix.de
Tue May 6 10:31:58 GMT 2003


At 11:47 06.05.2003 +0200, Jelmer Vernooij wrote:
>On Tue, May 06, 2003 at 07:10:37AM +0200, Stefan (metze) Metzmacher wrote 
>about 'register events':
> > thanks for applying my patch:-)
>
> > But there's one thing I didn't understand...
>
> > Why have you remove the check if an event tries to register twice???
> > We have to avoid this!!! Otherwise we'll get a corrupted list!!
> > When the same event struct pointer will be registered twice....
>You only check whether the pointer is already there.

Yep, that's what we need to do!
A DLIST deal with this pointers and if the same struct (same memoryblock)
will be added twice with DLIST_ADD() the list is corrupted!...

>  If a module
>constructs an event struct itself the memory address is different each
>time so we don't detect events registered twice.

A module should be able to do this e.g. for multiple instances
or on a connection basis...

>  We could check for
>duplicate function pointers, but I don't think that is necessary.
>
> > And really should not trust the modules...
>Events will be registered in init_module(), after other stuff has been
>registered. If that stuff fails, we shouldn't register the exit and
>interval events. It's the problem of the module, really.

The modules would mostly register the events in the e.g. ldapsam_init() fn or
vfs_antivir_connect() and unregister in vfs_antivir_disconnect()

or something like that the event should be only registered when the module 
is used not at smb_register_(vfs,passdb,auth,rpc) time.



metze
-----------------------------------------------------------------------------
Stefan "metze" Metzmacher <metze at metzemix.de> 



More information about the samba-technical mailing list