RES: [squid-users] External_acl and negative_ttl (possible bug?)

From: Valdir Henrique Dias Leite <[email protected]>
Date: Tue, 19 Oct 2004 15:20:46 -0300

Henrik, thank you for your reply!

My squid.conf has those lines:

external_acl_type LULA_EXTERNAL ttl=120 negative_ttl=10 children=10 %LOGIN
%DST /usr/local/squid/libexec/lula
acl LULA external LULA_EXTERNAL
http_access allow LULA

And the helper is (main blocks):

int main () {

[ ... OPEN CONNECTION, DEFINE PATHS, CONSTS, ETC ... ]

        setvbuf(stdout, NULL, _IOLBF, 0);

        while (fgets (line, sizeof (line), stdin)) {
           if ((cp = strchr (line, '\n')) != NULL) {
               *cp = '\0';
                                }
           if ((cp = strtok (line, " \t")) != NULL) {
              login = cp;
              destination = strtok (NULL, " \t");
          } else {
                fprintf (stderr, "helper: unable to read tokens\n");
          }

          tt = time(NULL);
          stm = localtime(&tt);

          if ( login[0] == ' ' || login[0] == '\0' ||
               destination[0] == ' ' || destination[0] == '\0' ) {
            return_result(err);
            break;
          }

          sprintf(query, " MYSELECT HERE " );

          resrc = mysql_query(mysqlDB,query);
          resultSet = mysql_store_result(mysqlDB);
          affecRows = mysql_affected_rows(mysqlDB);
          if ( affecRows == 0 ) {
            res = (char *)err;
          } else {
            res = (char *)ok;
          }

          mysql_free_result(resultSet);
        
          // return OK or ERR to Squid
          fprintf(stdout, "%s\n", res);

        }

        mysql_close(mysqlDB);

        return 0;
}

What is wrong ? The logic works fine, but always i change a table (say,
include a new URL), that changes doesn�t reflected by squid (the user can�t
access the new url inserted, for example).

Thank you,

Valdir

-----Mensagem original-----
De: Henrik Nordstrom [mailto:hno@squid-cache.org]
Enviada em: ter�a-feira, 19 de outubro de 2004 15:02
Para: Valdir Henrique Dias Leite
Cc: squid-users@squid-cache.org
Assunto: Re: [squid-users] External_acl and negative_ttl (possible bug?)

Esta mensagem usa um conjunto de caracteres que n�o � suportado pelo
Internet Mail Service. Para visualizar o conte�do original da mensagem,abra
a mensagem anexada. Se o texto n�o for exibido corretamente, salve o anexo
no disco e abra-o utilizando um vizualizador que possa exibir o conjunto de
caracteres original.
Received on Tue Oct 19 2004 - 12:21:17 MDT

This archive was generated by hypermail pre-2.1.9 : Mon Nov 01 2004 - 12:00:02 MST