You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by David Calavera <da...@gmail.com> on 2018/06/18 15:06:45 UTC

[PROPOSAL] Make atscppapi::RegisterGlobalPlugin return a value

I noticed that atscppapi::RegisterGlobalPlugin doesn't return any value.
This makes impossible for plugins that use to to know whether they need to
abort initialization or continue after registering the plugin.

I'm proposing to change the method signature to return a boolean value, so
plugins can abort in case of failure.

Example:

```
void TSPluginInit(int argc, const char *argv[]) {
  if (!atscppapi::RegisterGlobalPlugin("netlify", "netlify",
david@netlify.com") {
    return;
  }
}
```

I've opened a PullRequest with this change. If this proposal is accepted, I
can update all examples and plugins with the new behavior in the same Pull
Request:

https://github.com/apache/trafficserver/pull/3846

Re: [PROPOSAL] Make atscppapi::RegisterGlobalPlugin return a value

Posted by Masakazu Kitajo <ma...@apache.org>.
+1

On Tue, Jun 19, 2018 at 0:20 Derek Dagit <de...@oath.com.invalid> wrote:

> +1
>
> On Mon, Jun 18, 2018 at 10:09 AM, Alan Carroll <
> solidwallofcode@oath.com.invalid> wrote:
>
> > +1
> >
> > On Mon, Jun 18, 2018 at 10:06 AM, David Calavera <
> david.calavera@gmail.com
> > >
> > wrote:
> >
> > > I noticed that atscppapi::RegisterGlobalPlugin doesn't return any
> value.
> > > This makes impossible for plugins that use to to know whether they need
> > to
> > > abort initialization or continue after registering the plugin.
> > >
> > > I'm proposing to change the method signature to return a boolean value,
> > so
> > > plugins can abort in case of failure.
> > >
> > > Example:
> > >
> > > ```
> > > void TSPluginInit(int argc, const char *argv[]) {
> > >   if (!atscppapi::RegisterGlobalPlugin("netlify", "netlify",
> > > david@netlify.com") {
> > >     return;
> > >   }
> > > }
> > > ```
> > >
> > > I've opened a PullRequest with this change. If this proposal is
> > accepted, I
> > > can update all examples and plugins with the new behavior in the same
> > Pull
> > > Request:
> > >
> > > https://github.com/apache/trafficserver/pull/3846
> > >
> >
>
>
>
> --
> Derek
>

Re: [PROPOSAL] Make atscppapi::RegisterGlobalPlugin return a value

Posted by Derek Dagit <de...@oath.com.INVALID>.
+1

On Mon, Jun 18, 2018 at 10:09 AM, Alan Carroll <
solidwallofcode@oath.com.invalid> wrote:

> +1
>
> On Mon, Jun 18, 2018 at 10:06 AM, David Calavera <david.calavera@gmail.com
> >
> wrote:
>
> > I noticed that atscppapi::RegisterGlobalPlugin doesn't return any value.
> > This makes impossible for plugins that use to to know whether they need
> to
> > abort initialization or continue after registering the plugin.
> >
> > I'm proposing to change the method signature to return a boolean value,
> so
> > plugins can abort in case of failure.
> >
> > Example:
> >
> > ```
> > void TSPluginInit(int argc, const char *argv[]) {
> >   if (!atscppapi::RegisterGlobalPlugin("netlify", "netlify",
> > david@netlify.com") {
> >     return;
> >   }
> > }
> > ```
> >
> > I've opened a PullRequest with this change. If this proposal is
> accepted, I
> > can update all examples and plugins with the new behavior in the same
> Pull
> > Request:
> >
> > https://github.com/apache/trafficserver/pull/3846
> >
>



-- 
Derek

Re: [PROPOSAL] Make atscppapi::RegisterGlobalPlugin return a value

Posted by Alan Carroll <so...@oath.com.INVALID>.
+1

On Mon, Jun 18, 2018 at 10:06 AM, David Calavera <da...@gmail.com>
wrote:

> I noticed that atscppapi::RegisterGlobalPlugin doesn't return any value.
> This makes impossible for plugins that use to to know whether they need to
> abort initialization or continue after registering the plugin.
>
> I'm proposing to change the method signature to return a boolean value, so
> plugins can abort in case of failure.
>
> Example:
>
> ```
> void TSPluginInit(int argc, const char *argv[]) {
>   if (!atscppapi::RegisterGlobalPlugin("netlify", "netlify",
> david@netlify.com") {
>     return;
>   }
> }
> ```
>
> I've opened a PullRequest with this change. If this proposal is accepted, I
> can update all examples and plugins with the new behavior in the same Pull
> Request:
>
> https://github.com/apache/trafficserver/pull/3846
>

Re: [PROPOSAL] Make atscppapi::RegisterGlobalPlugin return a value

Posted by Bryan Call <bc...@apache.org>.
+1

-Bryan



> On Jun 18, 2018, at 8:06 AM, David Calavera <da...@gmail.com> wrote:
> 
> I noticed that atscppapi::RegisterGlobalPlugin doesn't return any value.
> This makes impossible for plugins that use to to know whether they need to
> abort initialization or continue after registering the plugin.
> 
> I'm proposing to change the method signature to return a boolean value, so
> plugins can abort in case of failure.
> 
> Example:
> 
> ```
> void TSPluginInit(int argc, const char *argv[]) {
>  if (!atscppapi::RegisterGlobalPlugin("netlify", "netlify",
> david@netlify.com") {
>    return;
>  }
> }
> ```
> 
> I've opened a PullRequest with this change. If this proposal is accepted, I
> can update all examples and plugins with the new behavior in the same Pull
> Request:
> 
> https://github.com/apache/trafficserver/pull/3846