-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: enforce strict TCPEndpoint build #235
Conversation
Signed-off-by: Evgeny Malygin <[email protected]>
Also note that we don't have unit tests for this component |
In fact, I only see one usage of However, I don't know whether we can remove |
Signed-off-by: Evgeny Malygin <[email protected]>
Signed-off-by: Evgeny Malygin <[email protected]>
Signed-off-by: Evgeny Malygin <[email protected]>
Signed-off-by: Evgeny Malygin <[email protected]>
* Fix: enforce strict TCPEndpoint build Signed-off-by: Evgeny Malygin <[email protected]>
* Fix: enforce strict TCPEndpoint build Signed-off-by: Evgeny Malygin <[email protected]>
* Fix: enforce strict TCPEndpoint build Signed-off-by: Evgeny Malygin <[email protected]>
We have 2 similar routines:
bool TCPEndpoint::fromUri(const bsl::string& uri)
void TCPEndpoint::fromUriRaw(const bsl::string& uri)
The difference is that
fromUriRaw
does not return a bool result, does not perform as much checks and instead relies on a text usage contractExpects uri to be valid format.
In my opinion, the current implementation is error-prone, and we can enforce usage contract on a code level instead, at the price of some additional runtime checks.
Alternatively, I would prefer to remove
fromUriRaw
routine since we use it only withinmwc
, replacing its in-place usage withfromUri
.