RE: [squid-users] Trouble writing external acl helper

From: Adnan Shahzad <adnan.shahzad_at_lums.edu.pk>
Date: Wed, 14 Apr 2010 19:31:59 +0500

Dear All,

I am adding my problem if you ppl can solve by external ACL Helper.......

my clients mostly hitting local PC names as http request, which cause file descriptor in use and in that response Internet speed slow even dead slow......

Is it virus? What if I want to allow that them all, then how can I allow them.... Common thing them all is there is no .com or .org or .net. so is it possible that I make an acl that allow http request without having domain name (.com, .net or .org etc)

Looking forward to you response....

1271255037.123 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255037.194 1 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255037.264 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255037.334 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255037.404 1 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255037.476 1 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255037.544 1 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255037.614 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255037.686 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255037.755 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255037.832 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255037.894 1 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255037.965 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.036 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.105 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.175 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.245 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.316 1 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.386 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.455 1 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.526 1 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.596 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.673 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.736 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.806 1 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.876 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255038.947 1 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255039.016 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html
1271255039.090 0 10.90.0.103 TCP_DENIED/407 7629 OPTIONS http://iqra-pc/ - NONE/- text/html

-----Original Message-----
From: marriedto51 [mailto:johnmwilson_at_talktalk.net]
Sent: Wednesday, April 14, 2010 1:38 PM
To: squid-users_at_squid-cache.org
Subject: [squid-users] Trouble writing external acl helper

I am almost certainly missing something very basic, but I haven't found out
what after searching here and elsewhere, so any help will be greatly
appreciated.

I'm using squid 3.1 on Fedora 12 (64-bit).

I want to write an external acl helper (for fun!) and started with a toy
example written in C which is only going to allow the URL
"http://www.google.com". It works as I expect when I run it at the command
line (lines are read one-by-one from standard input and a reply of "OK" or
"ERR" appears on standard output), but the output I get from squid says:

    2010/04/14 08:40:23.731| helperOpenServers: Starting 5/5 'toy_helper'
processes
    ...
    2010/04/14 08:40:31.197| WARNING: toy_helper #1 (FD 7) exited
    2010/04/14 08:40:31.197| WARNING: toy_helper #3 (FD 11) exited
    2010/04/14 08:40:31.198| WARNING: toy_helper #2 (FD 9) exited
    2010/04/14 08:40:31.198| WARNING: toy_helper #4 (FD 13) exited
    2010/04/14 08:40:31.198| Too few toy_helper processes are running
    ...
    FATAL: The toy_helper helpers are crashing too rapidly, need help!

In the squid.conf file I've put:

    external_acl_type toy_helper %PATH /tmp/squid-tests/toy_helper
    acl toy external toy_helper

This squid.conf and the toy_helper executable are both in /tmp/squid-tests,
and everything there is world-readable.

Lastly, here is the source for toy_helper:

   1 #include <stdio.h>
   2 #include <string.h>
   3 #define BUFSIZE 8192
   4
   5 int
   6 main(int argc, char *argv[])
   7 {
   8
   9 char buf[BUFSIZE];
  10
  11 /* make standard output and input unbuffered */
  12 setvbuf(stdout, NULL, _IONBF, 0);
  13 setvbuf(stdin, NULL, _IONBF, 0);
  14
  15 /* main loop: read lines from stdin */
  16 while ( fgets(buf, sizeof(buf), stdin) )
  17 {
  18 if ( strcmp("http://www.google.com/\n", buf) == 0 )
  19 printf("OK\n");
  20 else
  21 printf("ERR\n");
  22 }
  23
  24 return 0;
  25 }

Thanks in advance for any clues,
John.

-- 
View this message in context: http://n4.nabble.com/Trouble-writing-external-acl-helper-tp1839464p1839464.html
Sent from the Squid - Users mailing list archive at Nabble.com.
Received on Wed Apr 14 2010 - 14:37:00 MDT

This archive was generated by hypermail 2.2.0 : Thu Apr 15 2010 - 12:00:04 MDT