url_rewrite_program doesn't work, redirector helpers are crashing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

url_rewrite_program doesn't work, redirector helpers are crashing

Rallph
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hello,

I am actually working on a URL filter that works with Squid and his url_rewrite_program.
I haven't installed SquidGuard or UFDBGuard either on my Debian 8.6 with Squid 3.5 (from sources).

The problem is : I can't find why must my program return to Squid, this page http://wiki.squid-cache.org/ConfigExamples/PhpRedirectors#PHP_Redirect_.28Simple.29 say that the output is "302:http://example.com/\n" ...
But when you look at http://wiki.squid-cache.org/Features/AddonHelpers#HTTP_Redirection it says that the output must be something like "0 OK status=302 url=http://example.com/\n 302:http://example.com/\n" and it doesn't work.
I've tried "0 OK status=302 url=http://example.com/\n" but Squid tells me "ERROR: URL rewrite helper returned invalid result code. Wrong Helper? {result=Unknown}" and I can not find something to fix it.

Also, sometimes, Squid tell me "ERROR: The redirector helpers are crashing too rapidly, need help!" and I can't find out what is the problem since my URL rewriter program works perfectly when I launch it by myself.

Furthemore I have a warning: "Too few redirector processes are running (2/64)" I guess this is because I set 64 to the url_rewrite_children in the squid.conf but I don't understand why am I getting this warning.

Thank you :)
Reply | Threaded
Open this post in threaded view
|

Re: url_rewrite_program doesn't work, redirector helpers are crashing

babajaga
This post has NOT been accepted by the mailing list yet.
OK status=302 url=http://example.com/\n

is correct. Remove the '0 ' from the beginning.
Reply | Threaded
Open this post in threaded view
|

Re: url_rewrite_program doesn't work, redirector helpers are crashing

Rallph
This post has NOT been accepted by the mailing list yet.
According to http://www.squid-cache.org/Versions/v3/3.5/cfgman/url_rewrite_children.html, when the concurrency is >=1, Squid add an ID in front of the response and this is the 0 here (in fact I parse it with my C program and of course I printf the parsed value, not '0')