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

Lee ler762 at gmail.com
Mon Jul 30 18:40:12 UTC 2018


On 7/29/18, Fabian Keil <fk at fabiankeil.de> wrote:
> 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()

thank you - I'll see if either one of them will do what I want except faster

> but using them
> for this would require more hacking.

I've already gone overboard; I added a new cgi function that has zero
disk accesses for checking if a url is blocked or not, so what's a bit
more hacking? ;-)

Lee


More information about the Privoxy-devel mailing list