Re: [squid-users] Info on redirector's pattern

From: Chris Robertson <crobertson@dont-contact.us>
Date: Tue, 07 Mar 2006 11:42:36 -0900

Stefano Del Furia wrote:

> In data Mon, 06 Mar 2006 22:43:34 +0100, Mark Elsen
> <mark.elsen@gmail.com> ha scritto:
>
>>> Hi all,
>>> i'm trying to build an educational project, for a Squid's
>>> redirector and i
>>> would like to know what is the pattern to build it.
>>> I think that could be this:
>>>
>>> main
>>> {
>>> while true
>>> {
>>> read stdin
>>> perform analysis
>>> write to stdout
>>> }
>>> }
>>>
>>> I'm on the right way or i miss something ???
>>> Thanks in advance
>>> Stefano
>>>
>>
>> http://www.squid-cache.org/Doc/FAQ/FAQ-15.html
>>
>> M.
>>
>>
>> --
>> No virus found in this incoming message.
>> Checked by AVG Free Edition.
>> Version: 7.1.375 / Virus Database: 268.2.0/275 - Release Date: 06/03/06
>>
> Thanks for the info.
> I have read and i think to understand the process.
> So i have build a simple redirector in C# under windows environment
> like this:
>
> string text = "";
> while ( Console.In.Peek() != -1 )
> {
> text = Console.In.ReadLine();
> Console.Out.WriteLine(text.ToUpper());
> }
>
> But squid terminates every times that ad url is passed to redirector.

Note the example executes in a continuous loop. Your redirector is
exiting after processing each url (e.g. when -1 == Console.In.Peek()
). Either add a surrounding loop that executes continuously, or modify
the loop you have.

> If i restart squid all works for another url and than stops again. ...
> and so on.
>
> On the squid's log i get:
>
> 2006/03/07 16:13:15| WARNING: redirector #1 (FD 7) exited
> 2006/03/07 16:13:15| Too few redirector processes are running
> 2006/03/07 16:13:15| storeDirWriteCleanLogs: Starting...
> 2006/03/07 16:13:15| WARNING: Closing open FD 20
> 2006/03/07 16:13:15| Finished. Wrote 242 entries.
> 2006/03/07 16:13:15| Took 0.0 seconds ( 242.0 entries/sec).
> FATAL: The redirector helpers are crashing too rapidly, need help!
>
> Could someone explain me why ?
> Thanks in advance
>
> Squid Cache (Version 2.5.STABLE12-NT): Terminated abnormally.

Chris
Received on Tue Mar 07 2006 - 13:42:56 MST

This archive was generated by hypermail pre-2.1.9 : Sat Apr 01 2006 - 12:00:03 MST