[Privoxy-devel] 0007-Create-a-fast-CGI-function

Lee ler762 at protonmail.com
Tue Aug 29 14:01:44 CEST 2023


On Sunday, August 27th, 2023 at 11:37 AM, Fabian Keil wrote:

> I'm proposing that "we" add code

I hope that "we" means that you would be the one adding code.  What you're proposing is beyond my ability :(

> that optionally lets Privoxy ignore
> the templates and skip work that isn't needed for your use case.

That was what I originally wanted to do.
The patch I gave you is pretty much my limit.  I wanted to return just
  Final results:
  + or - block
but I couldn't figure out how to do only that :(

> I just would prefer that "we" keep the /show-url-info handler and
> don't add another one that then does work the already existing
> one could do instead.

That would be fine.

> > > What do you think about adding support for three additional
> > > optional variables to the "/show-url-info" handler instead?
> > > 
> > > Naming is hard, but right of my head we could add support
> > > for "final-results-only=1"
> > 
> > And that would use an in-memory template instead of reading it in from
> > disk?
> 
> 
> I think the "final-results-only=1" should only suppress the non-final
> matches while "format=text/plain" should result in no reading of the
> HTML templates.

What happens when the user gives just "final-results-only=1"?  The template gets read in and the result is returned as text/html?
Same deal if only "format=text/plain" is specified.. all the intermediate results are returned along with the final results as text/plain?

While I might be able to deal with "format=text/plain", I doubt it would be any time soon.
I took a quick look and didn't even see where "Content-Type: text/html" is set in the return header; making the content-type be text/html or text/plain would be a problem for me.

And if I get to add to my wish-list of things to do that are beyond my ability to do, it would be nice if the "final-results-only=1" output was created in a single output buffer.  The way Privoxy works now, the headers go in one buffer and the body goes in another - resulting in the user program having to do two reads to get the results; one to get the HTTP 1.1 200 OK headers and another to get the <DOCTYPE html> text.  It'd be faster if all that was sent/received in a single buffer.

> "We" could use an in-memory text-based template or simple build the
> output page on the fly without using any template which should be
> even faster as it wouldn't require pcrs.

Again.. you could do that.  I doubt I'd be able to get that done any time soon.

> > > Finally
> > > we could add something like "include-multi-actions=0".

In general, it's nice being that general, but is there really a use case for three independent options?

All I wanted was just two lines returned:
  Final results:
  + or - block
but I couldn't figure out how to do only that so I settled for just the 'Final results:' without all the multi-actions info.

Are you imagining a case where someone would want one or two of
  final-results-only=1
  format=text/plain
  include-multi-actions=0
but not all three?

and .. do you really want to allow final-results-only=0 or include-multi-actions=1 ?
Maybe just a single flag that means final results only, no multi-actions and content-type: text/plain would be better?

Regards,
Lee



More information about the Privoxy-devel mailing list