-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
There are a few issues with InitialConnectionContext
- Not all the fields are explicitly initialized in its constructor
InitialConnectionContext::InitialConnectionContext(bool isIncoming,
const bsl::string& name)
: d_isIncoming(isIncoming)
, d_name(name)
, d_resultState_p(0)
, d_userData_p(0)
InitialConnectionContext
constructor is not explicit- Allocator not provided
- Fields are not defined in the alignment-aware order. Fields start with 1-byte bool, then huge padding and bsl::string, ...
- There are multiple setters that can be reduced to constructor args to simplify API
bsl::shared_ptr<InitialConnectionContext> initialConnectionContext;
initialConnectionContext.createInplace(d_allocator_p,
context->d_isIncoming);
(*initialConnectionContext)
.setUserData(context->d_negotiationUserData_sp.get())
.setResultState(context->d_resultState_p)
.setChannel(channel)
.setCompleteCb(bdlf::BindUtil::bind(
&TCPSessionFactory::negotiationComplete,
this,
bdlf::PlaceHolders::_1, // status
bdlf::PlaceHolders::_2, // errorDescription
bdlf::PlaceHolders::_3, // session
bdlf::PlaceHolders::_4, // channel
bdlf::PlaceHolders::_5, // initialConnectionContext
context));
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers