Skip to content
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

Slow query fix & queryFunc optimisation #1694

Merged
merged 4 commits into from Sep 21, 2017

Conversation

Projects
None yet
2 participants
@WaLLy3K
Copy link
Collaborator

WaLLy3K commented Sep 17, 2017

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

How familiar are you with the codebase?:

9


  • Validate modified code using Shellcheck & Strict Bash

  • Added and/or elaborated more comments

  • scanlist() should exit if /etc/pihole is not available

  • Add export LC_CTYPE=C to prevent extreme grep slowdown on Debian Stretch

  • Consider "domain.com#comment" an exact match

  • Add specialised wildcard searching grep

  • Optimise and simplify queryFunc() for readability

  • Replace IDN python parsing with idn2, as python is not guaranteed to be available

  • Use ${COL_BOLD} when printing filenames

  • Add idn2 dependency


Options tested on all types of domains:

  • No options
  • -exact
  • -adlist
  • -exact -adlist
  • -bp

Domains tested:

  • No domain
  • Blacklisted
  • Whitelisted
  • Wildcarded (single match)
  • Wildcarded (multiple match - Known issue: No plural for "match" text)
  • Standard (single match)
  • Standard (multiple match)
  • Standard (100+ matches)
  • Standard (100+ matches) -all
  • Standard, xn-- style punycode(single match)
  • Standard, xn-- style punycode (multiple match)
  • Standard, non ASCII IDN (single match)
  • Standard, non ASCII IDN (multiple match)

WaLLy3K added some commits Sep 17, 2017

Slow query fix & queryFunc optimisation
* Validate modified code using Shellcheck & Strict Bash
* Added and/or elaborated more comments

* scanlist() should exit if /etc/pihole is not available
* Add `export LC_CTYPE=C` to prevent extreme grep slowdown
* Consider "domain.com#comment" an exact match
* Add specialised wildcard searching grep

* Optimise and simplify queryFunc() for readability
* Replace IDN `python` parsing with `idn2`, as `python` is not guaranteed to be available
* Use ${COL_BOLD} when printing filenames

@WaLLy3K WaLLy3K added this to the v3.2 milestone Sep 17, 2017

WaLLy3K added some commits Sep 17, 2017

Fix invalid option case
* Ensure `pihole -q doubleclick.com asd` exits with error
Prevent Block Page issue
* Block Page expects to see a full stop, otherwise it will throw an unhandled error
@PromoFaux

This comment has been minimized.

Copy link
Member

PromoFaux commented Sep 21, 2017

Approved

@PromoFaux PromoFaux merged commit a0bd517 into development Sep 21, 2017

5 checks passed

codacy/pr Good work! A positive pull request.
Details
code-review/pullapprove Approved by PromoFaux, WaLLy3K
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@PromoFaux PromoFaux deleted the fix/qf-opt branch Sep 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.