[Privoxy-devel] speeding up show-url-info

Fabian Keil fk at fabiankeil.de
Sun Jul 29 10:24:13 UTC 2018


Lee <ler762 at gmail.com> wrote:

> Is there a faster way to determine if a url is blocked than the
> MAX_AF_FILES loop in cgi_show_url_info?
> 
> The idea is to grab something like
> https://github.com/StevenBlack/hosts and turn it into a privoxy block
> list - with all the stuff that's already blocked commented out.  So
> all I'm looking for is this 'final results' line:
> <br>-<a href="http://config.privoxy.org/user-manual/actions-file.html#BLOCK">block</a>
> from http://config.privoxy.org/show-url-info
> 
> I'm guessing the
>       for (i = 0; i < MAX_AF_FILES; i++)
>          for ( ; b != NULL; b = b->next)
>             if (url_match(b->url, url_to_query))
>                if (merge_current_action(action, b->action))
> 
> is about as good as can be, but considering all I want is the 'is it
> blocked or no' line I'm wondering if there might be a faster way.

There are get_url_actions() and block_url() but using them
for this would require more hacking.

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.privoxy.org/pipermail/privoxy-devel/attachments/20180729/cd1f7595/attachment-0001.bin>


More information about the Privoxy-devel mailing list