[network] add socket option introspection#5351
Merged
mattklein123 merged 4 commits intoenvoyproxy:masterfrom Dec 21, 2018
Merged
[network] add socket option introspection#5351mattklein123 merged 4 commits intoenvoyproxy:masterfrom
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
Conversation
We want to be able to introspect the options being passed around without needing to actually apply them. The simplest way to do this is to have them return the values they would set. Since the values may differ based on who they are visiting, this introspection takes into account the socket and state passed in. Signed-off-by: Kyle Larose <kyle@agilicus.com>
Suggestions from review. Signed-off-by: Kyle Larose <kyle@agilicus.com>
Contributor
Author
|
@zuercher I'd appreciate it you looked over this again (since it's just a chunk of what you've already reviewed. :) ) |
zuercher
reviewed
Dec 20, 2018
Member
zuercher
left a comment
There was a problem hiding this comment.
Looks good! One nit and a question.
Signed-off-by: Kyle Larose <kyle@agilicus.com>
Rather than returning a detail whose option may collide with other unsupported options, just return nullopt making it appear as though it wouldn't be added to the socket. Signed-off-by: Kyle Larose <kyle@agilicus.com>
mattklein123
approved these changes
Dec 21, 2018
fredlas
pushed a commit
to fredlas/envoy
that referenced
this pull request
Mar 5, 2019
We want to be able to introspect the options being passed around without needing to actually apply them. The simplest way to do this is to have them return the values they would set. Since the values may differ based on who they are visiting, this introspection takes into account the socket and state passed in. Signed-off-by: Kyle Larose <kyle@agilicus.com> Signed-off-by: Fred Douglas <fredlas@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description: In PR #5035 I added the ability to get information of what low level options would be applied to a socket option. This is useful for unit testing. Since I am likely going to cancel that PR, I figured it'd make sense to submit this functionality separately. I intend on using it in future PRs.
From the commit:
Risk Level: Low. A simple read-only extension of an existing interface that is not invoked from any production code. The riskiest change is the refactoring of AddrFamilyAwareSocketOption, but its UTs continue to pass.
Testing: Added new UT for the new code. Ran UT on //test/common/network/... and //test/common/upstream/...
Docs Changes: None
Release Notes: None