Re: [squid-users] Redirect fails

From: Henrik Nordstrom <[email protected]>
Date: Mon, 3 Jan 2005 00:06:45 +0100 (CET)

On Fri, 31 Dec 2004, Rajesh K. Gupta wrote:

> When a web-browser requests a URL (redirection enabled), Squid returns
> nothing to the browser (and browser continues to wait for response).
>
> The redirection program is being executed (simple perl script) which
> just returns a blank line. (no URL modification occurs).
>
> #start simple redirect, which really does not redirect yet
> #!/usr/bin/perl
>
> while (<>) {
> print "\n";
> }
> #end simple redirect

You need to disable stdout buffering in Perl, if not the response from
your program gets buffered by the libc stdio routines and never reaches
Squid.

At the top of the script before the while insert

$|=1;

Regards
JHenrik
Received on Sun Jan 02 2005 - 16:06:49 MST

This archive was generated by hypermail pre-2.1.9 : Mon Mar 07 2005 - 12:59:35 MST