Make ESIParser::Parsers a std::list#138
Merged
yadij merged 3 commits intosquid-cache:masterfrom Jan 30, 2018
Merged
Conversation
Resolves assertions on shutdown and an outstanding TODO.
rousskov
approved these changes
Jan 29, 2018
Contributor
rousskov
left a comment
There was a problem hiding this comment.
No objection if this works better than the current asserting code, but the new code can be made more reliable.
src/esi/Parser.cc
Outdated
|
|
||
| char *ESIParser::Type = NULL; | ||
| ESIParser::Register *ESIParser::Parsers = NULL; | ||
| std::list<ESIParser::Register *> ESIParser::Parsers; |
Contributor
There was a problem hiding this comment.
Ideally, Parsers should be a pointer (to std::list or a similar container) so that we do not implicitly rely on the container object to already be there when we need to register a parser and to still be there when we need to deregister a parser.
I would also rename Parsers to ParserMakers or similar because we do not store Parsers in this container. We store "Register"(sic) objects that make Parsers (AFAICT).
Contributor
Author
There was a problem hiding this comment.
Thanks for the reminder. Using our lookup function technique now instead.
squidadm
pushed a commit
to squidadm/squid
that referenced
this pull request
Feb 1, 2018
... and Replace ESIParser::Parsers global with ESIParser::GetRegistry() lookup function Resolves assertions on shutdown and an outstanding TODO.
yadij
added a commit
that referenced
this pull request
Feb 2, 2018
... and Replace ESIParser::Parsers global with ESIParser::GetRegistry() lookup function Resolves assertions on shutdown and an outstanding TODO.
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.
Resolves assertions on shutdown and an outstanding TODO.