Re: Action syntax/semantics

Fabian Keil <[email protected]> Mon, 13 Apr 2015 14:27:33 +0200
Newsgroups gmane.comp.web.privoxy.devel
Message-ID <[email protected]>
Gregory Seidman <[email protected]> wrote:

> On Sun, Apr 12, 2015 at 12:45:30PM +0200, Fabian Keil wrote:
> > Gregory Seidman <[email protected]> wrote:
> > 
> > > I'm working on a Firefox addon to reimplement Privoxy functionality.
> > > Yes, I know there are various addons that do various things Privoxy
> > > does, but my goal is to be able to import/export valid Privoxy .action
> > > and .filter files (though, of course, external filters and a few actions
> > > can't be supported). To do so, I need to be sure I understand the syntax
> > > and semantics. So, some questions:
> > > 
> > > - Does any action OPTIONALLY take a parameter? In particular, is the
> > >   parameter to the block action required?
> > 
> > In general, parameters are documented to be required but for some
> > actions missing parameters will merely result in an error message
> > but are otherwise accepted for backwards compatibility.
> > 
> > The block action is (currently) one of them, but this may change
> > in the future (as the block reason was introduced years ago).
> 
> Are there any others?

The block action is the only formally parameterized action that
is currently accepted without parameter, however Privoxy currently
doesn't properly sanity-check parameter content in general and thus
does not reject other kinds of invalid parameters right away.

For details see parsers.c and actions.c.

>                       I'm trying to follow Postel's Law and be liberal in
> what I accept, so I don't want to reject files the real Privoxy accepts.

In my opinion Privoxy is actually too liberal and should reject
more input than it currently does. Properly rejecting invalid input
makes it less likely that Privoxy operates differently than the user
intended.

Changing this is on the TODO list and work in progress:
http://ijbswa.cvs.sourceforge.net/viewvc/ijbswa/current/TODO?view=markup#l70

> > >   actions all claim to be "Parameterized" in the documentation
> > >   <http://www.privoxy.org/user-manual/actions-file.html>, but aren't they
> > >   actually "Multi-value" in that more than one filter or tagger of the
> > >   same type (but with different parameters) can be applied to a matched
> > >   connection?
> > 
> > Indeed. Thanks for pointing this out, I'll look into fixing this.
> 
> Excellent, thank you for the clarifications.

You're welcome.

Fabian

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF

_______________________________________________
Ijbswa-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ijbswa-developers
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJVK7YuAAoJEGkYIpGLojccq3AP/jl0AUki7ColgTHnT4n3e0ZN
5IdCZOxWst3h5gRab6Yu1w6MJuf4Hi1gGEvI/ZB1MbrSQffrq3fs1ByGkAOiaoEP
/MfHAQP4Jbb1JX5/PWCGKB6jUAVmL4j2Gq3nzd1rd8geg5aWSx8sQ7/u0b4VrjAr
09YXtRKTYXtCifY6X2KNEPdXn+YG0u29qXTwmnQ7PBomz8decHHoi9INEMYlWCjp
jtcifMVGg6+kfSm0IYaGUUzBADMLO0RO0ucx/Af3rzFJsvljVV8sgAZfO/xB6+Bu
bDpeJNEcRdvXEsi8ils8q56x/TyILEjMZtGo4mKUzb5Ljm1tFjoDPH12nfmm7oCE
sY+JeHi1TkAS8wrwjkgZOwuXWS6j+Dud05Q/0vYKwsp1X/7X5673kHSHDO9lS/Yg
d3hOqY6uyAH10s0OAqu93+ZvF/yi/Ugh7NBsejZO/72J/d/JvRgBiLY/f8WwEwaK
660VQ1tX3rz7D1urxZqfpZXHjmSZaNu9vvHC6MCS8s2sQ3x184LB1OsTfiM+hmEe
MJWl1OS8iWyqDjZdn1VxM+p2HY//1Xla6krwEMScgubPre1LiPaqWBiatO4qWy7D
VqlUcn6HPoNINMC6pDBan4INMICukhUDWxnOSaRHsYy+sEBWm5F0XuCtiHp3oKG7
gm7h0FQa12M3uHREh6pB
=TPvm
-----END PGP SIGNATURE-----