/*
- * $Id: client_side.cc,v 1.87 1997/02/04 19:10:15 wessels Exp $
+ * $Id: client_side.cc,v 1.88 1997/02/07 04:57:10 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
LOCAL_ARRAY(char, msg, 8192);
LOCAL_ARRAY(char, line, 256);
StoreEntry *entry;
-debug(0,0,"Config.Options.enable_purge = %d\n", Config.Options.enable_purge);
+ debug(0, 0, "Config.Options.enable_purge = %d\n", Config.Options.enable_purge);
if (!Config.Options.enable_purge) {
buf = access_denied_msg(icpState->http_code = 401,
icpState->method,
/*
- * $Id: comm.cc,v 1.134 1997/02/07 04:55:56 wessels Exp $
+ * $Id: comm.cc,v 1.135 1997/02/07 04:57:12 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
#ifdef IP_MULTICAST_TTL
char ttl = (char) mcast_ttl;
if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, 1) < 0)
- debug(50, 1, "comm_set_mcast_ttl: FD %d, TTL: %d: %s\n",
+ debug(50, 1, "comm_set_mcast_ttl: FD %d, TTL: %d: %s\n",
fd, mcast_ttl, xstrerror());
#endif
return 0;
/*
- * $Id: disk.cc,v 1.53 1997/02/05 04:54:44 wessels Exp $
+ * $Id: disk.cc,v 1.54 1997/02/07 04:57:12 wessels Exp $
*
* DEBUG: section 6 Disk I/O Routines
* AUTHOR: Harvest Derived
if (len < 0) {
if (errno == EAGAIN || errno == EWOULDBLOCK)
break;
- /* disk i/o failure--flushing all outstanding writes */
- debug(50, 1, "diskHandleWrite: FD %d: disk write error: %s\n",
- fd, xstrerror());
- entry->write_daemon = NOT_PRESENT;
- entry->write_pending = NO_WRT_PENDING;
- /* call finish handler */
- do {
+ /* disk i/o failure--flushing all outstanding writes */
+ debug(50, 1, "diskHandleWrite: FD %d: disk write error: %s\n",
+ fd, xstrerror());
+ entry->write_daemon = NOT_PRESENT;
+ entry->write_pending = NO_WRT_PENDING;
+ /* call finish handler */
+ do {
entry->write_q = r->next;
if (r->free)
(r->free) (r->buf);
safe_free(r);
- } while (entry->write_q);
- if (entry->wrt_handle) {
- entry->wrt_handle(fd,
- errno == ENOSPC ? DISK_NO_SPACE_LEFT : DISK_ERROR,
+ } while (entry->write_q);
+ if (entry->wrt_handle) {
+ entry->wrt_handle(fd,
+ errno == ENOSPC ? DISK_NO_SPACE_LEFT : DISK_ERROR,
rlen,
- entry->wrt_handle_data);
- }
- return DISK_ERROR;
+ entry->wrt_handle_data);
}
+ return DISK_ERROR;
+ }
rlen += len;
r->cur_offset += len;
if (r->cur_offset < r->len)
continue; /* partial write? */
- /* complete write */
+ /* complete write */
entry->write_q = r->next;
if (r->free)
(r->free) (r->buf);
safe_free(r);
}
if (entry->write_q == NULL) {
- /* no more data */
+ /* no more data */
entry->write_q_tail = NULL;
- entry->write_pending = NO_WRT_PENDING;
- entry->write_daemon = NOT_PRESENT;
+ entry->write_pending = NO_WRT_PENDING;
+ entry->write_daemon = NOT_PRESENT;
} else {
commSetSelect(fd,
COMM_SELECT_WRITE,
{
dread_ctrl *ctrl_dat;
if (fd < 0)
- fatal_dump("file_read: bad FD");
+ fatal_dump("file_read: bad FD");
ctrl_dat = xcalloc(1, sizeof(dread_ctrl));
ctrl_dat->fd = fd;
ctrl_dat->offset = offset;
/*
- * $Id: dns.cc,v 1.29 1997/02/06 18:02:10 wessels Exp $
+ * $Id: dns.cc,v 1.30 1997/02/07 04:57:13 wessels Exp $
*
* DEBUG: section 34 Dnsserver interface
* AUTHOR: Harvest Derived
close(fd);
close(cfd);
if (Config.Options.res_defnames)
- execlp(command, "(dnsserver)", "-D", NULL);
+ execlp(command, "(dnsserver)", "-D", NULL);
else
- execlp(command, "(dnsserver)", NULL);
+ execlp(command, "(dnsserver)", NULL);
debug(50, 0, "dnsOpenServer: %s: %s\n", command, xstrerror());
_exit(1);
return 0;
/*
- * $Id: fqdncache.cc,v 1.44 1997/02/04 23:18:16 wessels Exp $
+ * $Id: fqdncache.cc,v 1.45 1997/02/07 04:57:13 wessels Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
{
char *buf = NULL;
if (!BIT_TEST(dns->flags, DNS_FLAG_ALIVE))
- debug_trap("Dispatching a dead DNS server");
+ debug_trap("Dispatching a dead DNS server");
if (!fqdncacheHasPending(f)) {
debug(35, 0, "fqdncache_dnsDispatch: skipping '%s' because no handler.\n",
f->name);
/*
- * $Id: main.cc,v 1.134 1997/02/06 19:01:46 wessels Exp $
+ * $Id: main.cc,v 1.135 1997/02/07 04:57:14 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
leave_suid(); /* Run as non privilegied user */
if (geteuid() == 0) {
- debug(0,0,"Squid is not safe to run as root! If you must\n");
- debug(0,0,"start Squid as root, then you must configure\n");
- debug(0,0,"it to run as a non-priveledged user with the\n");
- debug(0,0,"'cache_effective_user' option in the config file.\n");
+ debug(0, 0, "Squid is not safe to run as root! If you must\n");
+ debug(0, 0, "start Squid as root, then you must configure\n");
+ debug(0, 0, "it to run as a non-priveledged user with the\n");
+ debug(0, 0, "'cache_effective_user' option in the config file.\n");
fatal("Don't run Squid as root, set 'cache_effective_user'!");
}
-
if (httpPortNumOverride != 1)
Config.Port.http = (u_short) httpPortNumOverride;
if (icpPortNumOverride != 1)
if (Config.Announce.on)
eventAdd("send_announce", send_announce, NULL, 3600);
eventAdd("ipcache_purgelru", (EVH) ipcache_purgelru, NULL, 10);
+ eventAdd("peerUpdateFudge", peerUpdateFudge, NULL, 10);
}
first_time = 0;
}
/*
- * $Id: neighbors.cc,v 1.112 1997/02/07 04:56:17 wessels Exp $
+ * $Id: neighbors.cc,v 1.113 1997/02/07 04:57:15 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
debug(15, 4, "neighborsUdpPing: pinging peer %s for '%s'\n",
e->host, url);
- if (e->type == PEER_MULTICAST)
+ if (e->type == PEER_MULTICAST)
comm_set_mcast_ttl(theOutIcpConnection, e->mcast_ttl);
reqnum = storeReqnum(entry, request->method);
debug(15, 3, "neighborsUdpPing: key = '%s'\n", entry->key);
debug(15, 3, "neighborsUdpPing: %s: ack_deficit = %d\n",
e->host, e->stats.ack_deficit);
if (e->type == PEER_MULTICAST) {
- e->stats.ack_deficit = 0;
- ICP_mcasts_sent++;
+ e->stats.ack_deficit = 0;
+ ICP_mcasts_sent++;
} else if (neighborUp(e)) {
/* its alive, expect a reply from it */
- mem->e_pings_n_pings++;
+ mem->e_pings_n_pings++;
} else {
/* Neighbor is dead; ping it anyway, but don't expect a reply */
/* log it once at the threshold */
query,
LOG_TAG_NONE,
PROTO_NONE);
- ICP_queries_sent++;
+ ICP_queries_sent++;
}
} else {
debug(15, 6, "neighborsUdpPing: Source Ping: unknown host: %s\n",
eventAdd("peerUpdateFudge", peerUpdateFudge, NULL, 10);
debug(15, 3, "peerUpdateFudge: Factor = %d\n", MulticastFudgeFactor);
}
-
/*
- * $Id: stat.cc,v 1.124 1997/02/05 04:53:31 wessels Exp $
+ * $Id: stat.cc,v 1.125 1997/02/07 04:57:16 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
if (e->host == NULL)
fatal_dump("Found an peer without a hostname!");
storeAppendPrintf(sentry, "\n{%-11.11s: %s/%d/%d}\n",
- e->type == PEER_PARENT ? "Parent" : "Sibling",
+ neighborTypeStr(e),
e->host,
e->http_port,
e->icp_port);
storeAppendPrintf(sentry, "{PINGS ACKED: %8d %3d%%}\n",
e->stats.pings_acked,
percent(e->stats.pings_acked, e->stats.pings_sent));
+ storeAppendPrintf(sentry, "{FETCHES : %8d %3d%%}\n",
+ e->stats.fetches,
+ percent(e->stats.fetches, e->stats.pings_acked));
storeAppendPrintf(sentry, "{IGNORED : %8d %3d%%}\n",
e->stats.ignored_replies,
percent(e->stats.ignored_replies, e->stats.pings_acked));
for (op = ICP_OP_INVALID; op < ICP_OP_END; op++) {
if (e->stats.counts[op] == 0)
continue;
- storeAppendPrintf(sentry, "{%-10.10s : %8d %3d%%}\n",
+ storeAppendPrintf(sentry, "{ %12.12s : %8d %3d%%}\n",
IcpOpcodeStr[op],
e->stats.counts[op],
percent(e->stats.counts[op], e->stats.pings_acked));
}
- storeAppendPrintf(sentry, "{FETCHES : %8d %3d%%}\n",
- e->stats.fetches,
- percent(e->stats.fetches, e->stats.pings_acked));
-
if (e->last_fail_time) {
storeAppendPrintf(sentry, "{Last failed connect() at: %s}\n",
mkhttpdlogtime(&(e->last_fail_time)));
debug(18, 0, "Cannot open logfile: %s\n", obj->logfilename);
obj->logfile_status = LOG_DISABLE;
}
-
}
/* at the moment, store one char to make a storage manager happy */
storeAppendPrintf(sentry, " ");
/*
- * $Id: store.cc,v 1.208 1997/02/07 04:56:40 wessels Exp $
+ * $Id: store.cc,v 1.209 1997/02/07 04:57:17 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
};
struct _bucketOrder {
- unsigned int bucket;
- int index;
+ unsigned int bucket;
+ int index;
};
/* initializtion flag */
qsort((char *) MaintBucketsOrder,
store_buckets,
sizeof(struct _bucketOrder),
- (QS) compareBucketOrder);
+ (QS) compareBucketOrder);
}
static void
sprintf(tmp_error_buf, "Cannot open swap logfile: %s", swaplog_file);
fatal(tmp_error_buf);
}
-
stop = getCurrentTime();
r = stop - start;
debug(20, 1, " Finished. Wrote %d lines.\n", n);