[Olsr-dev] plugin initialisation
Ferry Huberts
(spam-protected)
Wed Dec 8 22:09:23 CET 2010
On 12/08/2010 05:18 PM, Henning Rogge wrote:
>
> On Wednesday 08 December 2010 09:26:08 Ferry Huberts wrote:
>
> > On 12/08/2010 09:15 AM, Ferry Huberts wrote:
>
> > > Hi list,
>
> > >
>
> > > I'm writing a plugin and have a question about plugin initialisation:
>
> > > it seems that the return value of the plugin init function is not
>
> > > checked in plugin_loader::init_olsr_plugin on line 303.
>
> > >
>
> > > Is this on purpose or an oversight?
>
> > >
>
> > > My plugin can fail init but currently olsrd still starts up in
> that case.
>
> >
>
> > PS. this is on stable
>
> >
>
> > the function definition is in plugin_loader.h, line 52
>
> I think the problem is that there is no good reaction at the moment
> for a failed initialization. If the plugin author (you for example)
> knows that OLSRd cannot work without the plugin, then he can just call
> olsr_exit() to stop the initialization process.
>
> We have been thinking about a "fail fast startup" parameter for 0.7.0,
> which would kill OLSRd in reaction to the result of initialization.
>
>
I think this is rather odd since setters for configuration parameters
are allowed to fail and will stop olsrd when they do.
IMHO the plugin initialisation is 'the same thing': init phase.
So allowing one part of this to stop olsrd but not the second part seems
strange.
The good reaction would be to stop olsrd, just like in part one.
Also, why then is the plugin init function defined to return an int when
this int is then ignored? :-)
I would definitely vote to not ignore it (obviously)
Care to take a patch for that?
--
Ferry Huberts
More information about the Olsr-dev
mailing list