]> git.pld-linux.org Git - packages/squid.git/blob - squid-2.5.STABLE2-external_acl_ttl0.patch
- obsolete
[packages/squid.git] / squid-2.5.STABLE2-external_acl_ttl0.patch
1 Index: squid/src/external_acl.c
2 diff -c squid/src/external_acl.c:1.1.2.23 squid/src/external_acl.c:1.1.2.25
3 *** squid/src/external_acl.c:1.1.2.23   Sat May 10 16:17:44 2003
4 --- squid/src/external_acl.c    Sat May 17 12:35:25 2003
5 ***************
6 *** 397,435 ****
7   aclMatchExternal(void *data, aclCheck_t * ch)
8   {
9       int result;
10 !     external_acl_entry *entry;
11       external_acl_data *acl = data;
12       const char *key = "";
13       debug(82, 9) ("aclMatchExternal: acl=\"%s\"\n", acl->def->name);
14 !     entry = ch->extacl_entry;
15       if (entry) {
16 !       if (cbdataValid(entry) && entry->def == acl->def &&
17 !           strcmp(entry->hash.key, key) == 0) {
18 !           /* Ours, use it.. */
19 !       } else {
20 !           /* Not valid, or not ours.. get rid of it */
21             cbdataUnlock(ch->extacl_entry);
22             ch->extacl_entry = NULL;
23             entry = NULL;
24         }
25       }
26       if (!entry) {
27 -       if (acl->def->require_auth) {
28 -           int ti;
29 -           /* Make sure the user is authenticated */
30 -           if ((ti = aclAuthenticated(ch)) != 1) {
31 -               debug(82, 2) ("aclMatchExternal: %s user not authenticated (%d)\n", acl->def->name, ti);
32 -               return ti;
33 -           }
34 -       }
35 -       key = makeExternalAclKey(ch, acl);
36         entry = hash_lookup(acl->def->cache, key);
37         if (entry && external_acl_entry_expired(acl->def, entry)) {
38             /* Expired entry, ignore */
39             debug(82, 2) ("external_acl_cache_lookup: '%s' = expired\n", key);
40             entry = NULL;
41         }
42 -       ch->auth_user_request = NULL;
43       }
44       if (!entry || entry->result == -1) {
45         debug(82, 2) ("aclMatchExternal: %s(\"%s\") = lookup needed\n", acl->def->name, key);
46 --- 397,438 ----
47   aclMatchExternal(void *data, aclCheck_t * ch)
48   {
49       int result;
50 !     external_acl_entry *entry = NULL;
51       external_acl_data *acl = data;
52       const char *key = "";
53       debug(82, 9) ("aclMatchExternal: acl=\"%s\"\n", acl->def->name);
54 !     if (ch->extacl_entry) {
55 !       entry = ch->extacl_entry;
56 !       if (!cbdataValid(entry))
57 !           entry = NULL;
58 !       cbdataUnlock(ch->extacl_entry);
59 !       ch->extacl_entry = NULL;
60 !     }
61 !     if (acl->def->require_auth) {
62 !       int ti;
63 !       /* Make sure the user is authenticated */
64 !       if ((ti = aclAuthenticated(ch)) != 1) {
65 !           debug(82, 2) ("aclMatchExternal: %s user not authenticated (%d)\n", acl->def->name, ti);
66 !           return ti;
67 !       }
68 !     }
69 !     key = makeExternalAclKey(ch, acl);
70 !     ch->auth_user_request = NULL;
71       if (entry) {
72 !       if (entry->def != acl->def || strcmp(entry->hash.key, key) != 0) {
73 !           /* Not ours.. get rid of it */
74             cbdataUnlock(ch->extacl_entry);
75             ch->extacl_entry = NULL;
76             entry = NULL;
77         }
78       }
79       if (!entry) {
80         entry = hash_lookup(acl->def->cache, key);
81         if (entry && external_acl_entry_expired(acl->def, entry)) {
82             /* Expired entry, ignore */
83             debug(82, 2) ("external_acl_cache_lookup: '%s' = expired\n", key);
84             entry = NULL;
85         }
86       }
87       if (!entry || entry->result == -1) {
88         debug(82, 2) ("aclMatchExternal: %s(\"%s\") = lookup needed\n", acl->def->name, key);
This page took 0.093848 seconds and 3 git commands to generate.