-/* $Id: cache_cf.cc,v 1.26 1996/04/09 18:18:46 wessels Exp $ */
+/* $Id: cache_cf.cc,v 1.27 1996/04/09 18:20:26 wessels Exp $ */
/* DEBUG: Section 3 cache_cf: Configuration file parsing */
#define DefaultFtpUser "cached@" /* Default without domain */
#define DefaultAnnounceHost "sd.cache.nlanr.net"
#define DefaultAnnouncePort 3131
-#define DefaultAnnounceFile (char *)NULL /* default NONE */
-#define DefaultAnnounceRate 86400 /* every 24 hours */
+#define DefaultAnnounceFile (char *)NULL /* default NONE */
+#define DefaultAnnounceRate 86400 /* every 24 hours */
extern char *config_file;
printf(" For this run, however, cached will use %d minutes for clean_rate.\n", (int) (getCleanRate() / 60));
fflush(stdout); /* print message */
}
-
if (accel_ip_acl == NULL)
accel_ip_acl = proxy_ip_acl;
-/* $Id: main.cc,v 1.24 1996/04/09 18:18:50 wessels Exp $ */
+/* $Id: main.cc,v 1.25 1996/04/09 18:20:28 wessels Exp $ */
/* DEBUG: Section 1 main: startup and main loop */
}
if ((n = getAnnounceRate()) > 0) {
if (cached_curtime > last_announce + n)
- send_announce();
- last_announce = cached_curtime;
+ send_announce();
+ last_announce = cached_curtime;
}
/* house keeping */
break;
-/* $Id: send-announce.cc,v 1.5 1996/04/09 18:18:50 wessels Exp $ */
+/* $Id: send-announce.cc,v 1.6 1996/04/09 18:20:28 wessels Exp $ */
/*
- * DEBUG: Section 27 send-announce
+ * DEBUG: Section 27 send-announce
*/
#include "squid.h"
host = getAnnounceHost();
port = getAnnouncePort();
- if ((hp = ipcache_gethostbyname(host))== NULL) {
- debug(27,1,"send_announce: Unknown host '%s'\n", host);
+ if ((hp = ipcache_gethostbyname(host)) == NULL) {
+ debug(27, 1, "send_announce: Unknown host '%s'\n", host);
return;
}
if ((file = getAnnounceFile())) {
/* XXX could block */
fd = file_open(file, NULL, O_RDONLY);
- if (fd > -1 && (n = read(fd, sndbuf+l, BUFSIZ-l-1)) > 0);
- l += n;
- sndbuf[l] = '\0';
+ if (fd > -1 && (n = read(fd, sndbuf + l, BUFSIZ - l - 1)) > 0) {
+ l += n;
+ sndbuf[l] = '\0';
} else {
- debug(27,1,"send_announce: %s: %s\n", file, xstrerror());
+ debug(27, 1, "send_announce: %s: %s\n", file, xstrerror());
}
}
-
qdata = (icpUdpData *) xcalloc(1, sizeof(icpUdpData));
qdata->msg = xstrdup(sndbuf);
- qdata->len = strlen(sndbuf)+1;
+ qdata->len = strlen(sndbuf) + 1;
qdata->address.sin_family = AF_INET;
qdata->address.sin_port = htons(port);
memcpy(&qdata->address.sin_addr, hp->h_addr_list[0], hp->h_length);
comm_set_select_handler(theUdpConnection,
COMM_SELECT_WRITE,
(PF) icpUdpReply,
- (void *) qdata);
+ (void *) qdata);
}