/*
- * $Id: acl.cc,v 1.164 1998/05/11 18:44:31 rousskov Exp $
+ * $Id: acl.cc,v 1.165 1998/05/28 20:47:52 wessels Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
static void aclDestroyTimeList(acl_time_data * data);
static void aclDestroyProxyAuth(acl_proxy_auth * p);
static FREE aclFreeProxyAuthUser;
-static int aclMatchAclList(const acl_list *, aclCheck_t *);
+static int aclMatchAcl(struct _acl *, aclCheck_t *);
static int aclMatchInteger(intlist * data, int i);
static int aclMatchTime(acl_time_data * data, time_t when);
static int aclMatchIdent(wordlist * data, const char *ident);
return data->weekbits & (1 << tm.tm_wday) ? 1 : 0;
}
-int
+static int
aclMatchAcl(acl * acl, aclCheck_t * checklist)
{
request_t *r = checklist->request;
/* NOTREACHED */
}
-static int
+int
aclMatchAclList(const acl_list * list, aclCheck_t * checklist)
{
while (list) {
/*
- * $Id: neighbors.cc,v 1.217 1998/05/26 19:08:56 wessels Exp $
+ * $Id: neighbors.cc,v 1.218 1998/05/28 20:47:53 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
}
do_ping = !d->do_ping;
}
- if (0 == do_ping)
+ if (p->pinglist && 0 == do_ping)
return do_ping;
checklist.src_addr = request->client_addr;
checklist.request = request;
- for (a = p->acls; a; a = a->next) {
- if (aclMatchAcl(a->acl, &checklist)) {
- do_ping = a->op;
- break;
- }
- do_ping = !a->op;
- }
- return do_ping;
+ return aclMatchAclList(p->acls, &checklist);
}
/* Return TRUE if it is okay to send an ICP request to this peer. */
debug(15, 3) ("getDefaultParent: returning %s\n", p->host);
return p;
}
+ debug(15, 3) ("getDefaultParent: returning NULL\n");
return NULL;
}
/*
- * $Id: peer_select.cc,v 1.63 1998/05/27 18:36:33 wessels Exp $
+ * $Id: peer_select.cc,v 1.64 1998/05/28 20:47:54 wessels Exp $
*
* DEBUG: section 44 Peer Selection Algorithm
* AUTHOR: Duane Wessels
peerGetSomeParent(request_t * request, hier_code * code)
{
peer *p;
- debug(44, 3) ("peerGetSomeParent: called.\n");
+ debug(44, 3) ("peerGetSomeParent: %s %s\n",
+ RequestMethodStr[request->method],
+ request->host);
if ((p = getDefaultParent(request))) {
*code = DEFAULT_PARENT;
return p;
extern void aclNBCheck(aclCheck_t *, PF *, void *);
extern int aclCheckFast(const struct _acl_access *A, aclCheck_t *);
extern void aclChecklistFree(aclCheck_t *);
-extern int aclMatchAcl(struct _acl *, aclCheck_t *);
+extern int aclMatchAclList(const acl_list * list, aclCheck_t * checklist);
extern void aclDestroyAccessList(struct _acl_access **list);
extern void aclDestroyAcls(acl **);
extern void aclParseAccessLine(struct _acl_access **);