Skip to content

tls: allow nullptr as slot value - #13883

Merged
jmarantz merged 6 commits into
envoyproxy:masterfrom
jmarantz:tls-allow-nullptr
Nov 4, 2020
Merged

tls: allow nullptr as slot value#13883
jmarantz merged 6 commits into
envoyproxy:masterfrom
jmarantz:tls-allow-nullptr

Conversation

@jmarantz

@jmarantz jmarantz commented Nov 3, 2020

Copy link
Copy Markdown
Contributor

Commit Message: add support for null data to tls slot typed API, using optional references. To make these less cumbersome at call-sites, add a struct OptRef wrapper for absl::optional<std::reference_wrapper> that allows directly accessing via -> syntax if the caller can guarantee the optional reference is populated.
Additional Description:
Risk Level: low
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>

@mattklein123 mattklein123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I like it. LMK when you are ready for review.

FWIW, if you want some additional easy coding therapy, there are a ton of other callsites that would benefit from that wrapper. 👍

/wait

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz
jmarantz marked this pull request as ready for review November 3, 2020 23:16
Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz

jmarantz commented Nov 3, 2020

Copy link
Copy Markdown
Contributor Author

I think this is ready for review now; tests & doc are added.

@mattklein123 mattklein123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks regardless of what happens on the other PR this is a nice improvement as we get rid of more runOnAllThreads() variants.

@jmarantz
jmarantz merged commit 7620e7d into envoyproxy:master Nov 4, 2020
@jmarantz
jmarantz deleted the tls-allow-nullptr branch November 4, 2020 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants