This repository has been archived by the owner. It is now read-only.
Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upadded check to prevent checking filter rules against non-blockable URLs #101
+240
−11
Conversation
ad_block_client.cc
Outdated
| * - ws | ||
| * - wss | ||
| */ | ||
| bool isBlockableProtocol(const char *url, int urlLen) { |
This comment has been minimized.
This comment has been minimized.
bbondy
May 14, 2018
Member
I think we should add a mini state machine for this to avoid the allocations. Similar to how the normal parsing works with keeping an enum for the current state and the current char that is being processed.
|
@bbondy Okie dokie, i've reimplemented the protocol check to use a state machine style flow. It ended up being > 100 lines, so I moved it to its own file ( |
468f376
to
9ab10f4
…ine based design
9ab10f4
to
8c95910
|
Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
pes10k commentedMay 12, 2018
Added
isBlockableProtocolfunction inad_block_client.h/ccand corresponding tests intest/matching_test.ccQuick ignores URLs that don't start with one of the following (case insensitive, any of which can be prefix by
blob:):