[squid-users] Of redirect_program, perl, DBs and URLs

From: Tuc at T-B-O-H.NET <ml@dont-contact.us>
Date: Thu, 8 May 2008 14:04:09 -0400 (EDT)

Hi,

        I'm trying to implement a redirect_program in perl. Its
a fairly simple program. I'm trying to find a spot when a user
is accessing a directory or site, and if they aren't in the
"already showed file", generate a 302 to a page of my choice.

        For the URL, I'm checking for just /\/$/ , but have
run into some pages that use "/" to pass info to a banner
ad site so it gets lost. Is there a better check I should
be using? Maybe more along the lines of /[com|net|org|edu]\//
perhaps?

        The next is that when the process writes it to an NDBM
file, its not flushed or sync'd or something. So I'm using DB_File .
It has sync, and it seems to work well within the process, but if
I run an outside program to delete the entry so the user sees the
row again, even if I sync, it seems the perl doesn't see it.
Has anyone gotten around this? (Short of moving to MySQL)

                Thanks, Tuc
Received on Thu May 08 2008 - 18:04:28 MDT

This archive was generated by hypermail 2.2.0 : Tue May 13 2008 - 12:00:03 MDT