Search squid archive

External C program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux