[squid-users] External C program

From: Julien Philibin <julien_at_philibin.fr>
Date: Mon, 27 Apr 2009 22:20:13 -0700

Hi, I've been trying to find a typical external ACL C program skeleton
for a while, but I wasn't able to find anything very interesting ...

What I would like to do, is to read to different strings and process
them in order to allow/disallow access to a website.

This is what I have:

external.c

-------------

int main(int argc, char* argv[])
{
  char source[16];
  char dom[2000];

while (scanf("%s", &source)){
    setbuf( stdout, NULL);
    scanf("%s", &dom);

    /*
    Do some work
    */

    //Flush stdin
    setbuf (stdin, NULL);

    if (condition)
      printf("ERR\n");
    else
      printf("OK\n");

  }
}

-----------------

The thing is, after a while I get two processes that use around 10 Mb
of memory and 15% of my CPU ....
Also, if I restart squid, I'll get two more processes running and so
on, everytime I restart squid ...

Furthermore, as I am working on an SQL server, I get around 3k SQL
requests each second ... and the mysqld process is jumping on 70% of
CPU usage ... (And yes, I am the only one that is submitting requests
to the squid server, and no, I don't have any bittorent, emule, or any
other program that would generate such a heavy internet traffic)

Does anyone know where that could come from ?

Thank you all for your help!

Julien
Received on Tue Apr 28 2009 - 05:20:40 MDT

This archive was generated by hypermail 2.2.0 : Tue Apr 28 2009 - 12:00:02 MDT