> On April 26, 2016, 8:27 a.m., Adam B wrote: > > src/slave/http.cpp, line 360 > > <https://reviews.apache.org/r/46203/diff/13/?file=1359473#file1359473line360> > > > > Should this perhaps be a `Shared<>`?
I don't think so. `Shared<>` is about shared ownership, but the closure shouldn't own `Slave*`, but only use it. If we'd want to make sure that `slave_ != NULL` during the lifetime of the closure, we would have to use something like `std::weak_ptr`, managed by a shared pointer. I'd argue that because the `Slave` instance routes its HTTP requests to an `Http` instance, `slave_ != NULL` during the lifetime of the `Http` instance. Hence it's safe to use the pointer to `Slave` in the closure. Anyways, I'll change the closure to use `Flags` instead of `Slave*` as a parameter. The will be copied by value, object lifetime isn't a problem in that case. > On April 26, 2016, 8:27 a.m., Adam B wrote: > > src/slave/http.cpp, line 365 > > <https://reviews.apache.org/r/46203/diff/13/?file=1359473#file1359473line365> > > > > Why pass the entire Slave down when you only use the flags? Yes, much better approach. > On April 26, 2016, 8:27 a.m., Adam B wrote: > > src/tests/slave_authorization_tests.cpp, line 144 > > <https://reviews.apache.org/r/46203/diff/13/?file=1359475#file1359475line144> > > > > After reading the description of the test, I expected to see ACLs that > > set permissive=false, but adds a rule for GetEndpoint(ANY, "/flags") > > What you're testing is fully permissive ACLs, which is a bit different, > > and probably tested throughout the rest of the existing tests. Will change it. That way it'll be much clearer. - Jan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/46203/#review130538 ----------------------------------------------------------- On April 25, 2016, 2:50 p.m., Jan Schlicht wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/46203/ > ----------------------------------------------------------- > > (Updated April 25, 2016, 2:50 p.m.) > > > Review request for mesos, Adam B, Alexander Rojas, and Benjamin Bannier. > > > Bugs: MESOS-5142 > https://issues.apache.org/jira/browse/MESOS-5142 > > > Repository: mesos > > > Description > ------- > > See summary. > > > Diffs > ----- > > docs/configuration.md 86ba66ac62295ca148524bcb2e57fee560ac4ac5 > include/mesos/authorizer/acls.proto > c50deeb5565dfd5b3e5e7210283d9a36a3bfd579 > include/mesos/authorizer/authorizer.proto > 40d93ea257d1df8d22eee8a21667db90d579a8fe > src/Makefile.am e024c6d65608a55765e527a8668c415723dcfcca > src/authorizer/local/authorizer.cpp > 0a3805fe4ce8eb89e096e8cd4326035513ba892b > src/slave/flags.cpp 10d2974bd2b6e79255fc894979607f0d2d00c315 > src/slave/http.cpp 537736d1fe42e8150bad91326299ef9a17041a8e > src/slave/slave.hpp 20a4bcd0bb9dad06ea81fc4ad9b2fa462c69d2c5 > src/tests/slave_authorization_tests.cpp PRE-CREATION > > Diff: https://reviews.apache.org/r/46203/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Jan Schlicht > >
