[squid-users] traffic accounting via access.log named pipe (FIFO)

From: Michael Smirnov <smbsmb@dont-contact.us>
Date: Wed, 22 Sep 2004 16:43:00 +0400

We have a accounting/billing system, based on Squid on FreeBSD 4.x/5.x.
Squid writes its access.log to a "named pipe" (created by command "mkfifo").
A separate daemon reads data from this pipe, and communicates with the database,
decreaseing users' limits after they download something.

However, we discovered, that a user with small non-zero traffic limit
can download any 1 file, even if he has not enough limit.
For example, a user with $0.01 can download a huge ISO-image
(of course, if TCP connection won't break),
because the record about it is written to access.log AFTER he downloads it.

Is there a way solve this problem?
I think about a patch for Squid, which will make it
write a record after every N bytes of downloaded data (or every N minutes)
in every session.

If there's no better solution, please help to write this patch.
I can test it immediately.
Received on Wed Sep 22 2004 - 06:43:30 MDT

This archive was generated by hypermail pre-2.1.9 : Fri Oct 01 2004 - 12:00:02 MDT