return result;
}
-ACL::ACL () :cfgline(NULL) {}
+ACL::ACL() :
+ cfgline(NULL),
+ next(NULL)
+{
+ *name = 0;
+}
bool ACL::valid () const
{
data = data->next;
delete prev;
}
-
- delete data;
}
static int
async_(false),
finished_(false),
allow_(ACCESS_DENIED),
- state_(NullState::Instance())
+ state_(NullState::Instance()),
+ checking_(false)
{
}
// Bypass of browser same-origin access control in intercepted communication
// To resolve this we will force DIRECT and only to the original client destination.
// In which case, we also need this ACL to accurately match the destination
- if (Config.onoff.client_dst_passthru && checklist->request &&
- (checklist->request->flags.intercepted || checklist->request->flags.spoofClientIp)) {
+ if (Config.onoff.client_dst_passthru && (checklist->request->flags.intercepted || checklist->request->flags.spoofClientIp)) {
assert(checklist->conn() && checklist->conn()->clientConnection != NULL);
return ACLIP::match(checklist->conn()->clientConnection->local);
}
memset(&hints, 0, sizeof(struct addrinfo));
- if ( iptype != AF_UNSPEC ) {
- hints.ai_flags |= AI_NUMERICHOST;
- }
-
-#if 0
- if (Ip::EnableIpv6&IPV6_SPECIAL_V4MAPPING)
- hints.ai_flags |= AI_V4MAPPED | AI_ALL;
-#endif
-
int errcode = getaddrinfo(addr1,NULL,&hints,&hp);
if (hp == NULL) {
debugs(28, DBG_CRITICAL, "aclIpParseIpData: Bad host/IP: '" << addr1 <<
limit = (atoi (t));
/* suck out file contents */
-
+ // ignore comments
+ bool ignore = false;
while ((t = strtokFile())) {
+ ignore |= (*t != '#');
+
+ if (ignore)
+ continue;
+
+ debugs(89, DBG_CRITICAL, "WARNING: max_conn only accepts a single limit value.");
limit = 0;
}
}
return data == 0.0;
}
+bool
+ACLRandom::valid() const
+{
+ return !empty();
+}
+
/*******************/
/* aclParseRandomList */
/*******************/
char bufa[256], bufb[256];
t = strtokFile();
+ if (!t)
+ return;
+
debugs(28, 5, "aclParseRandomData: " << t);
// seed random generator ...
int a = xatoi(bufa);
int b = xatoi(bufb);
if (a == 0 || b == 0) {
- debugs(28, DBG_CRITICAL, "aclParseRandomData: Bad Pattern: '" << t << "'");
- self_destruct();
+ debugs(28, DBG_CRITICAL, "ERROR: ACL random with bad pattern: '" << t << "'");
+ return;
} else
data = a / (double)(a+b);
} else if (sscanf(t, "%[0-9]/%[0-9]", bufa, bufb) == 2) {
int a = xatoi(bufa);
int b = xatoi(bufb);
if (a == 0 || b == 0) {
- debugs(28, DBG_CRITICAL, "aclParseRandomData: Bad Pattern: '" << t << "'");
- self_destruct();
+ debugs(28, DBG_CRITICAL, "ERROR: ACL random with bad pattern: '" << t << "'");
+ return;
} else
data = (double) a / (double) b;
} else if (sscanf(t, "0.%[0-9]", bufa) == 1) {
data = atof(t);
} else {
- debugs(28, DBG_CRITICAL, "aclParseRandomData: Bad Pattern: '" << t << "'");
- self_destruct();
+ debugs(28, DBG_CRITICAL, "ERROR: ACL random with bad pattern: '" << t << "'");
+ return;
}
// save the exact input pattern. so we can display it later.
virtual int match(ACLChecklist *checklist);
virtual wordlist *dump() const;
virtual bool empty () const;
+ virtual bool valid() const;
protected:
static Prototype RegistryProtoype;