/*
- * $Id: access_log.cc,v 1.71 2001/10/17 12:41:49 hno Exp $
+ * $Id: access_log.cc,v 1.72 2001/10/24 06:55:43 hno Exp $
*
* DEBUG: section 46 Access Log
* AUTHOR: Duane Wessels
client = inet_ntoa(al->cache.caddr);
user = accessLogFormatName(al->cache.authuser ?
al->cache.authuser : al->cache.rfc931);
- logfilePrintf(logfile, "%9d.%03d %6d %s %s/%03d %d %s %s %s %s%s/%s %s",
+ logfilePrintf(logfile, "%9d.%03d %6d %s %s/%03d %ld %s %s %s %s%s/%s %s",
(int) current_time.tv_sec,
(int) current_time.tv_usec / 1000,
al->cache.msec,
client,
log_tags[al->cache.code],
al->http.code,
- al->cache.size,
+ (long int) al->cache.size,
al->private.method_str,
al->url,
user ? user : dash_str,
client = inet_ntoa(al->cache.caddr);
user1 = accessLogFormatName(al->cache.authuser);
user2 = accessLogFormatName(al->cache.rfc931);
- logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %d %s:%s",
+ logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %ld %s:%s",
client,
user2 ? user2 : dash_str,
user1 ? user1 : dash_str,
al->url,
al->http.version.major, al->http.version.minor,
al->http.code,
- al->cache.size,
+ (long int) al->cache.size,
log_tags[al->cache.code],
hier_strings[al->hier.code]);
safe_free(user1);
/*
- * $Id: acl.cc,v 1.267 2001/10/24 05:46:26 hno Exp $
+ * $Id: acl.cc,v 1.268 2001/10/24 06:55:43 hno Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
debug(28, 7) ("aclMatchUser: user is %s, case_insensitive is %d\n",
user, data->flags.case_insensitive);
debug(28, 8) ("Top is %p, Top->data is %s\n", Top,
- (char *)(Top != NULL ? (Top)->data : "Unavailable"));
+ (char *) (Top != NULL ? (Top)->data : "Unavailable"));
if (user == NULL)
return 0;
Top = splay_splay(user, Top, (SPLAYCMP *) strcmp);
/* Top=splay_splay(user,Top,(SPLAYCMP *)dumping_strcmp); */
debug(28, 7) ("aclMatchUser: returning %d,Top is %p, Top->data is %s\n",
- !splayLastResult, Top, (char *)(Top ? Top->data : "Unavailable"));
+ !splayLastResult, Top, (char *) (Top ? Top->data : "Unavailable"));
data->names = Top;
return !splayLastResult;
}
(*acldata)->flags.strict = 1;
} else {
(*acldata)->max = atoi(t);
- debug(28, 5) ("aclParseUserMaxIP: Max IP address's %d\n", (*acldata)->max);
+ debug(28, 5) ("aclParseUserMaxIP: Max IP address's %d\n", (int) (*acldata)->max);
}
} else
fatal("aclParseUserMaxIP: Malformed ACL %d\n");
char buf[128];
if (acldata->flags.strict)
wordlistAdd(&W, "-s");
- snprintf(buf, sizeof(buf), "%lu", (unsigned long int)acldata->max);
+ snprintf(buf, sizeof(buf), "%lu", (unsigned long int) acldata->max);
wordlistAdd(&W, buf);
return W;
}
}
if (ret == 0) {
debug(28, 0) ("WARNING: '%s' is a subdomain of '%s'\n", d1, d2);
- debug(28, 0) ("WARNING: because of this '%s' is ignored to keep splay tree searching predictable\n", (char *)a);
+ debug(28, 0) ("WARNING: because of this '%s' is ignored to keep splay tree searching predictable\n", (char *) a);
debug(28, 0) ("WARNING: You should probably remove '%s' from the ACL named '%s'\n", d1, AclMatchedName);
}
return ret;
/*
- * $Id: asn.cc,v 1.75 2001/10/24 05:46:26 hno Exp $
+ * $Id: asn.cc,v 1.76 2001/10/24 06:55:44 hno Exp $
*
* DEBUG: section 53 AS Number handling
* AUTHOR: Duane Wessels, Kostas Anagnostakis
asState->seen = asState->offset + size;
asState->offset += (s - buf);
debug(53, 3) ("asState->seen = %ld, asState->offset = %ld\n",
- (long int)asState->seen, (long int)asState->offset);
+ (long int) asState->seen, (long int) asState->offset);
if (e->store_status == STORE_PENDING) {
debug(53, 3) ("asHandleReply: store_status == STORE_PENDING: %s\n", storeUrl(e));
storeClientCopy(asState->sc,
/*
- * $Id: authenticate.cc,v 1.32 2001/10/24 05:46:26 hno Exp $
+ * $Id: authenticate.cc,v 1.33 2001/10/24 06:55:44 hno Exp $
*
* DEBUG: section 29 Authenticator
* AUTHOR: Duane Wessels
auth_user_t *auth_user;
char *username = NULL;
debug(29, 3) ("authenticateProxyUserCacheCleanup: Cleaning the user cache now\n");
- debug(29, 3) ("authenticateProxyUserCacheCleanup: Current time: %ld\n", (long int)current_time.tv_sec);
+ debug(29, 3) ("authenticateProxyUserCacheCleanup: Current time: %ld\n", (long int) current_time.tv_sec);
hash_first(proxy_auth_username_cache);
while ((usernamehash = ((auth_user_hash_pointer *) hash_next(proxy_auth_username_cache)))) {
auth_user = usernamehash->auth_user;
/* if we need to have inpedendent expiry clauses, insert a module call
* here */
- debug(29, 4) ("authenticateProxyUserCacheCleanup: Cache entry:\n\tType: %d\n\tUsername: %s\n\texpires: %ld\n\treferences: %d\n", auth_user->auth_type, username, (long int)(auth_user->expiretime + Config.authenticateTTL), auth_user->references);
+ debug(29, 4) ("authenticateProxyUserCacheCleanup: Cache entry:\n\tType: %d\n\tUsername: %s\n\texpires: %ld\n\treferences: %d\n", auth_user->auth_type, username, (long int) (auth_user->expiretime + Config.authenticateTTL), auth_user->references);
if (auth_user->expiretime + Config.authenticateTTL <= current_time.tv_sec) {
debug(29, 5) ("authenticateProxyUserCacheCleanup: Removing user %s from cache due to timeout.\n", username);
/* the minus 1 accounts for the cache lock */
/*
- * $Id: client_side.cc,v 1.553 2001/10/24 05:46:27 hno Exp $
+ * $Id: client_side.cc,v 1.554 2001/10/24 06:55:44 hno Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
callback(buf, 0, cbdata); /* Signal end of body */
return;
}
- debug(33, 2) ("clientReadBody: start fd=%d body_size=%lu in.offset=%ld cb=%p req=%p\n", conn->fd, (unsigned long int)conn->body.size_left, (long int)conn->in.offset, callback, request);
+ debug(33, 2) ("clientReadBody: start fd=%d body_size=%lu in.offset=%ld cb=%p req=%p\n", conn->fd, (unsigned long int) conn->body.size_left, (long int) conn->in.offset, callback, request);
conn->body.callback = callback;
conn->body.cbdata = cbdata;
conn->body.buf = buf;
CBCB *callback = conn->body.callback;
request_t *request = conn->body.request;
/* Note: request is null while eating "aborted" transfers */
- debug(33, 2) ("clientProcessBody: start fd=%d body_size=%lu in.offset=%ld cb=%p req=%p\n", conn->fd, (unsigned long int)conn->body.size_left, (long int)conn->in.offset, callback, request);
+ debug(33, 2) ("clientProcessBody: start fd=%d body_size=%lu in.offset=%ld cb=%p req=%p\n", conn->fd, (unsigned long int) conn->body.size_left, (long int) conn->in.offset, callback, request);
if (conn->in.offset) {
/* Some sanity checks... */
assert(conn->body.size_left > 0);
callback(buf, size, cbdata);
if (request != NULL)
requestUnlink(request); /* Linked in clientReadBody */
- debug(33, 2) ("clientProcessBody: end fd=%d size=%d body_size=%lu in.offset=%ld cb=%p req=%p\n", conn->fd, size, (unsigned long int)conn->body.size_left, (long int)conn->in.offset, callback, request);
+ debug(33, 2) ("clientProcessBody: end fd=%d size=%d body_size=%lu in.offset=%ld cb=%p req=%p\n", conn->fd, size, (unsigned long int) conn->body.size_left, (long int) conn->in.offset, callback, request);
}
}
clientReadBodyAbortHandler(char *buf, size_t size, void *data)
{
ConnStateData *conn = (ConnStateData *) data;
- debug(33, 2) ("clientReadBodyAbortHandler: fd=%d body_size=%lu in.offset=%ld\n", conn->fd, (unsigned long int)conn->body.size_left, (long int)conn->in.offset);
+ debug(33, 2) ("clientReadBodyAbortHandler: fd=%d body_size=%lu in.offset=%ld\n", conn->fd, (unsigned long int) conn->body.size_left, (long int) conn->in.offset);
if (size != 0 && conn->body.size_left != 0) {
debug(33, 3) ("clientReadBodyAbortHandler: fd=%d shedule next read\n", conn->fd);
conn->body.callback = clientReadBodyAbortHandler;
/*
- * $Id: comm_select.cc,v 1.52 2001/10/24 06:16:16 hno Exp $
+ * $Id: comm_select.cc,v 1.53 2001/10/24 06:55:44 hno Exp $
*
* DEBUG: section 5 Socket Functions
*
return COMM_OK;
}
while (timeout > current_dtime);
- debug(5, 8) ("comm_poll: time out: %ld.\n", (long int)squid_curtime);
+ debug(5, 8) ("comm_poll: time out: %ld.\n", (long int) squid_curtime);
return COMM_TIMEOUT;
}
/*
- * $Id: store_dir_ufs.cc,v 1.36 2001/10/17 13:43:06 hno Exp $
+ * $Id: store_dir_ufs.cc,v 1.37 2001/10/24 06:55:45 hno Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
} else if (tmpe.swap_file_sz == sb.st_size - swap_hdr_len) {
tmpe.swap_file_sz = sb.st_size;
} else if (tmpe.swap_file_sz != sb.st_size) {
- debug(20, 1) ("storeUfsDirRebuildFromDirectory: SIZE MISMATCH %d!=%d\n",
- tmpe.swap_file_sz, (int) sb.st_size);
+ debug(20, 1) ("storeUfsDirRebuildFromDirectory: SIZE MISMATCH %ld!=%ld\n",
+ (long int)tmpe.swap_file_sz, (long int) sb.st_size);
storeUfsDirUnlinkFile(SD, filn);
continue;
}
debug(20, 0) ("storeUfsCleanupDoubleCheck: FILENO %08X\n", e->swap_filen);
debug(20, 0) ("storeUfsCleanupDoubleCheck: PATH %s\n",
storeUfsDirFullPath(sd, e->swap_filen, NULL));
- debug(20, 0) ("storeUfsCleanupDoubleCheck: ENTRY SIZE: %d, FILE SIZE: %d\n",
- e->swap_file_sz, (int) sb.st_size);
+ debug(20, 0) ("storeUfsCleanupDoubleCheck: ENTRY SIZE: %ld, FILE SIZE: %ld\n",
+ (long int)e->swap_file_sz, (long int) sb.st_size);
storeEntryDump(e, 0);
return -1;
}
/*
- * $Id: store_io_ufs.cc,v 1.7 2001/03/03 10:39:39 hno Exp $
+ * $Id: store_io_ufs.cc,v 1.8 2001/10/24 06:55:45 hno Exp $
*
* DEBUG: section 79 Storage Manager UFS Interface
* AUTHOR: Duane Wessels
{
storeIOState *sio = my_data;
ufsstate_t *ufsstate = (ufsstate_t *) sio->fsstate;
- debug(79, 3) ("storeUfsWriteDone: dirno %d, fileno %08X, FD %d, len %d\n",
- sio->swap_dirn, sio->swap_filen, fd, len);
+ debug(79, 3) ("storeUfsWriteDone: dirno %d, fileno %08X, FD %d, len %ld\n",
+ sio->swap_dirn, sio->swap_filen, fd, (long int)len);
ufsstate->flags.writing = 0;
if (errflag) {
debug(79, 0) ("storeUfsWriteDone: got failure (%d)\n", errflag);
/*
- * $Id: main.cc,v 1.344 2001/10/24 06:16:16 hno Exp $
+ * $Id: main.cc,v 1.345 2001/10/24 06:55:44 hno Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
debug(1, 1) ("Preparing for shutdown after %d requests\n",
statCounter.client_http.requests);
debug(1, 1) ("Waiting %d seconds for active connections to finish\n",
- (int)wait);
+ (int) wait);
do_shutdown = 0;
shutting_down = 1;
serverConnectionsClose();
/*
- * $Id: peer_digest.cc,v 1.82 2001/10/24 06:16:17 hno Exp $
+ * $Id: peer_digest.cc,v 1.83 2001/10/24 06:55:44 hno Exp $
*
* DEBUG: section 72 Peer Digest Routines
* AUTHOR: Alex Rousskov
eventAdd("peerDigestCheck", peerDigestCheck, pd, (double) delay, 1);
pd->times.next_check = squid_curtime + delay;
debug(72, 3) ("peerDigestSetCheck: will check peer %s in %d secs\n",
- strBuf(pd->host), (int)delay);
+ strBuf(pd->host), (int) delay);
}
/*
}
debug(72, 3) ("peerDigestCheck: peer %s:%d\n", pd->peer->host, pd->peer->http_port);
debug(72, 3) ("peerDigestCheck: time: %ld, last received: %ld (%+d)\n",
- (long int)squid_curtime, (long int)pd->times.received, (int)(squid_curtime - pd->times.received));
+ (long int) squid_curtime, (long int) pd->times.received, (int) (squid_curtime - pd->times.received));
/* decide when we should send the request:
* request now unless too close to other requests */
/* per-peer limit */
if (req_time - pd->times.received < PeerDigestReqMinGap) {
debug(72, 2) ("peerDigestCheck: %s, avoiding close peer requests (%d < %d secs).\n",
- strBuf(pd->host), (int)(req_time - pd->times.received),
- (int)PeerDigestReqMinGap);
+ strBuf(pd->host), (int) (req_time - pd->times.received),
+ (int) PeerDigestReqMinGap);
req_time = pd->times.received + PeerDigestReqMinGap;
}
/* global limit */
if (req_time - pd_last_req_time < GlobDigestReqMinGap) {
debug(72, 2) ("peerDigestCheck: %s, avoiding close requests (%d < %d secs).\n",
- strBuf(pd->host), (int)(req_time - pd_last_req_time),
- (int)GlobDigestReqMinGap);
+ strBuf(pd->host), (int) (req_time - pd_last_req_time),
+ (int) GlobDigestReqMinGap);
req_time = pd_last_req_time + GlobDigestReqMinGap;
}
if (req_time <= squid_curtime)
status = reply->sline.status;
debug(72, 3) ("peerDigestFetchReply: %s status: %d, expires: %ld (%+d)\n",
strBuf(pd->host), status,
- (long int)reply->expires, (int)(reply->expires - squid_curtime));
+ (long int) reply->expires, (int) (reply->expires - squid_curtime));
/* this "if" is based on clientHandleIMSReply() */
if (status == HTTP_NOT_MODIFIED) {
fetch->resp_time = squid_curtime - fetch->start_time;
debug(72, 3) ("peerDigestFetchFinish: recv %d bytes in %d secs\n",
- fetch->recv.bytes, (int)fetch->resp_time);
+ fetch->recv.bytes, (int) fetch->resp_time);
debug(72, 3) ("peerDigestFetchFinish: expires: %ld (%+d), lmt: %ld (%+d)\n",
- (long int)fetch->expires, (int)(fetch->expires - squid_curtime),
- (long int)fetch->entry->lastmod, (int)(fetch->entry->lastmod - squid_curtime));
+ (long int) fetch->expires, (int) (fetch->expires - squid_curtime),
+ (long int) fetch->entry->lastmod, (int) (fetch->entry->lastmod - squid_curtime));
}
storeAppendPrintf(e, "\tneeded: %3s, usable: %3s, requested: %3s\n",
f2s(needed), f2s(usable), f2s(requested));
storeAppendPrintf(e, "\n\tlast retry delay: %d secs\n",
- (int)pd->times.retry_delay);
+ (int) pd->times.retry_delay);
storeAppendPrintf(e, "\tlast request response time: %d secs\n",
- (int)pd->times.req_delay);
+ (int) pd->times.req_delay);
storeAppendPrintf(e, "\tlast request result: %s\n",
pd->req_result ? pd->req_result : "(none)");
/*
- * $Id: ssl_support.cc,v 1.4 2001/10/19 22:34:49 hno Exp $
+ * $Id: ssl_support.cc,v 1.5 2001/10/24 06:55:44 hno Exp $
*
* AUTHOR: Benno Rice
* DEBUG: section 81 SSL accelerator support
}
};
-static long
+static long
ssl_parse_options(const char *options)
{
long op = SSL_OP_ALL;
/*
- * $Id: stat.cc,v 1.349 2001/10/24 06:16:17 hno Exp $
+ * $Id: stat.cc,v 1.350 2001/10/24 06:55:44 hno Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
fd_table[fd].bytes_read, fd_table[fd].bytes_written);
storeAppendPrintf(s, "\tFD desc: %s\n", fd_table[fd].desc);
storeAppendPrintf(s, "\tin: buf %p, offset %ld, size %ld\n",
- conn->in.buf, (long int)conn->in.offset, (long int)conn->in.size);
+ conn->in.buf, (long int) conn->in.offset, (long int) conn->in.size);
storeAppendPrintf(s, "\tpeer: %s:%d\n",
inet_ntoa(conn->peer.sin_addr),
ntohs(conn->peer.sin_port));
storeAppendPrintf(s, "\tnrequests: %d\n",
conn->nrequests);
storeAppendPrintf(s, "\tdefer: n %d, until %ld\n",
- conn->defer.n, (long int)conn->defer.until);
+ conn->defer.n, (long int) conn->defer.until);
}
storeAppendPrintf(s, "uri %s\n", http->uri);
storeAppendPrintf(s, "log_type %s\n", log_tags[http->log_type]);
storeAppendPrintf(s, "out.offset %ld, out.size %lu\n",
- (long int)http->out.offset, (unsigned long int)http->out.size);
+ (long int) http->out.offset, (unsigned long int) http->out.size);
storeAppendPrintf(s, "req_sz %d\n", http->req_sz);
e = http->entry;
storeAppendPrintf(s, "entry %p/%s\n", e, e ? storeKeyText(e->hash.key) : "N/A");
e = http->old_entry;
storeAppendPrintf(s, "old_entry %p/%s\n", e, e ? storeKeyText(e->hash.key) : "N/A");
storeAppendPrintf(s, "start %ld.%06d (%f seconds ago)\n",
- (long int)http->start.tv_sec,
- (int)http->start.tv_usec,
+ (long int) http->start.tv_sec,
+ (int) http->start.tv_usec,
tvSubDsec(http->start, current_time));
storeAppendPrintf(s, "\n");
}
/*
- * $Id: store_client.cc,v 1.103 2001/10/24 06:16:18 hno Exp $
+ * $Id: store_client.cc,v 1.104 2001/10/24 06:55:44 hno Exp $
*
* DEBUG: section 20 Storage Manager Client-Side Interface
* AUTHOR: Duane Wessels
(void) 0; /* a match! */
else {
debug(20, 1) ("storeClientReadHeader: URL mismatch\n");
- debug(20, 1) ("\t{%s} != {%s}\n", (char *)t->value, mem->url);
+ debug(20, 1) ("\t{%s} != {%s}\n", (char *) t->value, mem->url);
swap_object_ok = 0;
break;
}
/*
- * $Id: store_digest.cc,v 1.50 2001/10/24 06:16:18 hno Exp $
+ * $Id: store_digest.cc,v 1.51 2001/10/24 06:55:44 hno Exp $
*
* DEBUG: section 71 Store Digest Manager
* AUTHOR: Alex Rousskov
}
store_digest = cacheDigestCreate(cap, Config.digest.bits_per_entry);
debug(71, 1) ("Local cache digest enabled; rebuild/rewrite every %d/%d sec\n",
- (int)Config.digest.rebuild_period, (int)Config.digest.rewrite_period);
+ (int) Config.digest.rebuild_period, (int) Config.digest.rewrite_period);
memset(&sd_state, 0, sizeof(sd_state));
cachemgrRegister("store_digest", "Store Digest",
storeDigestReport, 0, 1);
/* Note: We should use the time of the next rebuild, not (cur_time+period) */
if (refreshCheckDigest(e, Config.digest.rebuild_period)) {
debug(71, 6) ("storeDigestAdd: entry expires within %d secs, ignoring\n",
- (int)Config.digest.rebuild_period);
+ (int) Config.digest.rebuild_period);
return 0;
}
/*
"application/cache-digest", store_digest->mask_size + sizeof(sd_state.cblock),
squid_curtime, squid_curtime + Config.digest.rewrite_period);
debug(71, 3) ("storeDigestRewrite: entry expires on %ld (%+d)\n",
- (long int)e->mem_obj->reply->expires, (int)(e->mem_obj->reply->expires - squid_curtime));
+ (long int) e->mem_obj->reply->expires, (int) (e->mem_obj->reply->expires - squid_curtime));
storeBuffer(e);
httpReplySwapOut(e->mem_obj->reply, e);
storeDigestCBlockSwapOut(e);
storeComplete(e);
storeTimestampsSet(e);
debug(71, 2) ("storeDigestRewriteFinish: digest expires at %ld (%+d)\n",
- (long int)e->expires, (int)(e->expires - squid_curtime));
+ (long int) e->expires, (int) (e->expires - squid_curtime));
/* is this the write order? @?@ */
requestUnlink(e->mem_obj->request);
e->mem_obj->request = NULL;