/*
- * $Id: HttpStatusLine.cc,v 1.22 2001/01/12 00:37:14 wessels Exp $
+ * $Id: HttpStatusLine.cc,v 1.23 2001/02/23 20:59:50 hno Exp $
*
* DEBUG: section 57 HTTP Status-line
* AUTHOR: Alex Rousskov
}
if (!(start = strchr(start, ' ')))
return 0;
- sline->status = atoi(++start);
+ sline->status = (http_status)atoi(++start);
/* we ignore 'reason-phrase' */
return 1; /* success */
}
/*
- * $Id: acl.cc,v 1.248 2001/02/18 11:16:51 hno Exp $
+ * $Id: acl.cc,v 1.249 2001/02/23 20:59:50 hno Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
}
/* does name lookup, returns page_id */
-int
+err_type
aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name)
{
acl_deny_info_list *A = NULL;
A = *head;
if (NULL == *head) /* empty list */
- return -1;
+ return ERR_NONE;
while (A) {
L = A->acl_list;
if (NULL == L) /* empty list should never happen, but in case */
}
A = A->next;
}
- return -1;
+ return ERR_NONE;
}
/* does name lookup, returns if it is a proxy_auth acl */
int
aclCheckFast(const acl_access * A, aclCheck_t * checklist)
{
- int allow = 0;
+ allow_t allow = ACCESS_DENIED;
debug(28, 5) ("aclCheckFast: list: %p\n", A);
while (A) {
allow = A->allow;
if (aclMatchAclList(A->acl_list, checklist))
- return allow;
+ return allow == ACCESS_ALLOWED;
A = A->next;
}
- debug(28, 5) ("aclCheckFast: no matches, returning: %d\n", !allow);
- return !allow;
+ debug(28, 5) ("aclCheckFast: no matches, returning: %d\n", allow == ACCESS_DENIED);
+ return allow == ACCESS_DENIED;
}
static void
if (A->next)
cbdataLock(A->next);
}
- debug(28, 3) ("aclCheck: NO match found, returning %d\n", !allow);
- aclCheckCallback(checklist, !allow);
+ debug(28, 3) ("aclCheck: NO match found, returning %d\n", allow != ACCESS_DENIED ? ACCESS_DENIED : ACCESS_ALLOWED);
+ aclCheckCallback(checklist, allow != ACCESS_DENIED ? ACCESS_DENIED : ACCESS_ALLOWED);
}
void
/*
- * $Id: cache_cf.cc,v 1.376 2001/02/21 00:02:34 hno Exp $
+ * $Id: cache_cf.cc,v 1.377 2001/02/23 20:59:50 hno Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
dump_peer(StoreEntry * entry, const char *name, peer * p)
{
domain_ping *d;
- acl_access *a;
domain_type *t;
LOCAL_ARRAY(char, xname, 128);
while (p != NULL) {
d->do_ping ? null_string : "!",
d->domain);
}
- if ((a = p->access)) {
+ if (p->access) {
snprintf(xname, 128, "cache_peer_access %s", p->host);
dump_acl_access(entry, xname, p->access);
}
/*
- * $Id: cache_manager.cc,v 1.25 2001/01/12 00:37:15 wessels Exp $
+ * $Id: cache_manager.cc,v 1.26 2001/02/23 20:59:50 hno Exp $
*
* DEBUG: section 16 Cache Manager Objects
* AUTHOR: Duane Wessels
char *desc;
OBJH *handler;
struct {
- int pw_req:1;
- int atomic:1;
+ unsigned int pw_req:1;
+ unsigned int atomic:1;
} flags;
struct _action_table *next;
} action_table;
/*
- * $Id: client.cc,v 1.92 2001/02/07 19:10:12 hno Exp $
+ * $Id: client.cc,v 1.93 2001/02/23 20:59:50 hno Exp $
*
* DEBUG: section 0 WWW Client
* AUTHOR: Harvest Derived
int ping, pcount;
int keep_alive = 0;
int opt_noaccept = 0;
- int opt_put = 0;
int opt_verbose = 0;
char *hostname, *localhost;
char url[BUFSIZ], msg[BUFSIZ], buf[BUFSIZ];
xfree(t);
}
if (put_file) {
- opt_put = 1;
- /*method = xstrdup("PUT"); */
put_fd = open(put_file, O_RDONLY);
set_our_signal();
if (put_fd < 0) {
/*
- * $Id: client_db.cc,v 1.52 2001/01/12 00:37:15 wessels Exp $
+ * $Id: client_db.cc,v 1.53 2001/02/23 20:59:50 hno Exp $
*
* DEBUG: section 0 Client Database
* AUTHOR: Duane Wessels
break;
case MESH_CTBL_HTHITS:
aggr = 0;
- for (l = 0; l < LOG_TYPE_MAX; l++) {
+ for (l = LOG_TAG_NONE; l < LOG_TYPE_MAX; l++) {
if (isTcpHit(l))
aggr += c->Http.result_hist[l];
}
/*
- * $Id: client_side.cc,v 1.528 2001/02/20 22:49:23 hno Exp $
+ * $Id: client_side.cc,v 1.529 2001/02/23 20:59:50 hno Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
clientAccessCheckDone(int answer, void *data)
{
clientHttpRequest *http = data;
- int page_id = -1;
+ err_type page_id;
http_status status;
ErrorState *err = NULL;
char *proxy_auth_msg = NULL;
/* WWW authorisation needed */
status = HTTP_UNAUTHORIZED;
}
- if (page_id <= 0)
+ if (page_id == ERR_NONE)
page_id = ERR_CACHE_ACCESS_DENIED;
} else {
status = HTTP_FORBIDDEN;
- if (page_id <= 0)
+ if (page_id == ERR_NONE)
page_id = ERR_ACCESS_DENIED;
}
err = errorCon(page_id, status);
assert(http->redirect_state == REDIRECT_PENDING);
http->redirect_state = REDIRECT_DONE;
if (result) {
- http_status status = atoi(result);
- if (status == 301 || status == 302) {
+ http_status status = (http_status)atoi(result);
+ if (status == HTTP_MOVED_PERMANENTLY || status == HTTP_MOVED_TEMPORARILY) {
char *t = result;
if ((t = strchr(result, ':')) != NULL) {
http->redirect.status = status;
/*
- * $Id: comm_select.cc,v 1.48 2001/01/12 00:37:16 wessels Exp $
+ * $Id: comm_select.cc,v 1.49 2001/02/23 20:59:50 hno Exp $
*
* DEBUG: section 5 Socket Functions
*
static void comm_select_dns_incoming(void);
#endif
+#if !HAVE_POLL
static struct timeval zero_tv;
+#endif
static fd_set global_readfds;
static fd_set global_writefds;
static int nreadfds;
void
comm_select_init(void)
{
+#if !HAVE_POLL
zero_tv.tv_sec = 0;
zero_tv.tv_usec = 0;
+#endif
cachemgrRegister("comm_incoming",
"comm_incoming() stats",
commIncomingStats, 0, 1);
/*
- * $Id: fqdncache.cc,v 1.146 2001/01/12 00:37:17 wessels Exp $
+ * $Id: fqdncache.cc,v 1.147 2001/02/23 20:59:51 hno Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
{
static fqdncache_entry f;
int k;
- int j;
int na = 0;
memset(&f, '\0', sizeof(f));
f.expires = squid_curtime;
}
debug(35, 3) ("fqdncacheParse: %d answers\n", nr);
assert(answers);
- for (j = 0, k = 0; k < nr; k++) {
+ for (k = 0; k < nr; k++) {
if (answers[k].type != RFC1035_TYPE_PTR)
continue;
if (answers[k].class != RFC1035_CLASS_IN)
/*
- * $Id: ipcache.cc,v 1.232 2001/01/12 00:37:18 wessels Exp $
+ * $Id: ipcache.cc,v 1.233 2001/02/23 20:59:51 hno Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
ipcacheHandleReply(void *data, rfc1035_rr * answers, int na)
#endif
{
- int n;
generic_cbdata *c = data;
ipcache_entry *i = c->data;
ipcache_entry *x = NULL;
cbdataFree(c);
c = NULL;
- n = ++IpcacheStats.replies;
+ IpcacheStats.replies++;
statHistCount(&statCounter.dns.svc_time,
tvSubMsec(i->request_time, current_time));
#if USE_DNSSERVERS
/*
- * $Id: protos.h,v 1.398 2001/02/10 16:40:40 hno Exp $
+ * $Id: protos.h,v 1.399 2001/02/23 20:59:51 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
extern void aclParseAccessLine(struct _acl_access **);
extern void aclParseAclLine(acl **);
extern int aclIsProxyAuth(const char *name);
-extern int aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name);
+extern err_type aclGetDenyInfoPage(acl_deny_info_list ** head, const char *name);
extern void aclParseDenyInfoLine(struct _acl_deny_info_list **);
extern void aclDestroyDenyInfoList(struct _acl_deny_info_list **);
extern void aclDestroyRegexList(struct _relist *data);
#endif
/* String */
-#define strLen(s) ((const int)(s).len)
+#define strLen(s) ((/* const */ int)(s).len)
#define strBuf(s) ((const char*)(s).buf)
#define strChr(s,ch) ((const char*)strchr(strBuf(s), (ch)))
#define strRChr(s,ch) ((const char*)strrchr(strBuf(s), (ch)))
/*
- * $Id: snmp_core.cc,v 1.46 2001/01/12 00:37:21 wessels Exp $
+ * $Id: snmp_core.cc,v 1.47 2001/02/23 20:59:51 hno Exp $
*
* DEBUG: section 49 SNMP support
* AUTHOR: Glenn Chisholm
{
struct snmp_session Session;
struct snmp_pdu *RespPDU;
- int ret;
debug(49, 5) ("snmpConstructReponse: Called.\n");
RespPDU = snmpAgentResponse(rq->PDU);
Session.Version = SNMP_VERSION_1;
Session.community = rq->community;
Session.community_len = strlen((char *) rq->community);
- ret = snmp_build(&Session, RespPDU, rq->outbuf, &rq->outlen);
+ snmp_build(&Session, RespPDU, rq->outbuf, &rq->outlen);
sendto(rq->sock, rq->outbuf, rq->outlen, 0, (struct sockaddr *) &rq->from, sizeof(rq->from));
snmp_free_pdu(RespPDU);
xfree(rq->outbuf);
snmpTreeGet(oid * Current, snint CurrentLen)
{
oid_ParseFn *Fn = NULL;
- mib_tree_entry *mibTreeEntry = NULL, *lastEntry = NULL;
+ mib_tree_entry *mibTreeEntry = NULL;
int count = 0;
debug(49, 5) ("snmpTreeGet: Called\n");
if (Current[count] == mibTreeEntry->name[count]) {
count++;
while ((mibTreeEntry) && (count < CurrentLen) && (!mibTreeEntry->parsefunction)) {
- lastEntry = mibTreeEntry;
mibTreeEntry = snmpTreeEntry(Current[count], count, mibTreeEntry);
count++;
}
/*
- * $Id: store_dir.cc,v 1.126 2001/02/10 16:40:40 hno Exp $
+ * $Id: store_dir.cc,v 1.127 2001/02/23 20:59:51 hno Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
struct timeval start;
double dt;
SwapDir *sd;
- RemovalPolicyWalker **walkers;
int dirn;
int notdone = 1;
if (store_dirs_rebuilding) {
debug(20, 1) ("storeDirWriteCleanLogs: Starting...\n");
getCurrentTime();
start = current_time;
- walkers = xcalloc(Config.cacheSwap.n_configured, sizeof *walkers);
for (dirn = 0; dirn < Config.cacheSwap.n_configured; dirn++) {
sd = &Config.cacheSwap.swapDirs[dirn];
if (sd->log.clean.start(sd) < 0) {
/*
- * $Id: unlinkd.cc,v 1.42 2001/01/12 00:37:23 wessels Exp $
+ * $Id: unlinkd.cc,v 1.43 2001/02/23 20:59:51 hno Exp $
*
* DEBUG: section 12 Unlink Daemon
* AUTHOR: Duane Wessels
if (queuelen >= UNLINKD_QUEUE_LIMIT) {
struct timeval to;
fd_set R;
- int x;
FD_ZERO(&R);
FD_SET(unlinkd_rfd, &R);
to.tv_sec = 0;
to.tv_usec = 100000;
- x = select(unlinkd_rfd + 1, &R, NULL, NULL, &to);
+ select(unlinkd_rfd + 1, &R, NULL, NULL, &to);
}
/*
* If there is at least one outstanding unlink request, then
/*
- * $Id: urn.cc,v 1.65 2001/02/07 19:04:09 hno Exp $
+ * $Id: urn.cc,v 1.66 2001/02/23 20:59:51 hno Exp $
*
* DEBUG: section 52 URN Parsing
* AUTHOR: Kostas Anagnostakis
request_t *request;
request_t *urlres_r;
struct {
- int force_menu:1;
+ unsigned int force_menu:1;
} flags;
} UrnState;