This is another feature which is very much outdated and unused.
refresh.h \
repl_modules.h \
sbuf/StringConvert.h \
- send-announce.cc \
- send-announce.h \
stat.cc \
stat.h \
stmem.cc \
wordlist *hostnameAliases;
char *errHtmlText;
- struct {
- char *host;
- char *file;
- time_t period;
- unsigned short port;
- } Announce;
-
struct {
Ip::Address udp_incoming;
int buffered_logs;
int common_log;
int log_mime_hdrs;
- int announce;
int mem_pools;
int test_reachability;
int half_closed_clients;
}
#endif
- if (Config.Announce.period > 0) {
- Config.onoff.announce = 1;
- } else {
- Config.Announce.period = 86400 * 365; /* one year */
- Config.onoff.announce = 0;
- }
-
if (Config.onoff.httpd_suppress_version_string)
visible_appname_string = (char *)appname_string;
else
DOC_END
# Options removed in 6.x
+NAME: announce_file
+TYPE: obsolete
+DOC_START
+ Remove this line. Squid no longer supports this feature.
+DOC_END
+
+NAME: announce_host
+TYPE: obsolete
+DOC_START
+ Remove this line. Squid no longer supports this feature.
+DOC_END
+
+NAME: announce_period
+TYPE: obsolete
+DOC_START
+ Remove this line. Squid no longer supports this feature.
+DOC_END
+
+NAME: announce_port
+TYPE: obsolete
+DOC_START
+ Remove this line. Squid no longer supports this feature.
+DOC_END
+
NAME: request_entities
TYPE: obsolete
DOC_START
your value with 0.
DOC_END
-COMMENT_START
- OPTIONS FOR THE CACHE REGISTRATION SERVICE
- -----------------------------------------------------------------------------
-
- This section contains parameters for the (optional) cache
- announcement service. This service is provided to help
- cache administrators locate one another in order to join or
- create cache hierarchies.
-
- An 'announcement' message is sent (via UDP) to the registration
- service by Squid. By default, the announcement message is NOT
- SENT unless you enable it with 'announce_period' below.
-
- The announcement message includes your hostname, plus the
- following information from this configuration file:
-
- http_port
- icp_port
- cache_mgr
-
- All current information is processed regularly and made
- available on the Web at http://www.ircache.net/Cache/Tracker/.
-COMMENT_END
-
-NAME: announce_period
-TYPE: time_t
-LOC: Config.Announce.period
-DEFAULT: 0
-DEFAULT_DOC: Announcement messages disabled.
-DOC_START
- This is how frequently to send cache announcements.
-
- To enable announcing your cache, just set an announce period.
-
- Example:
- announce_period 1 day
-DOC_END
-
-NAME: announce_host
-TYPE: string
-DEFAULT: tracker.ircache.net
-LOC: Config.Announce.host
-DOC_START
- Set the hostname where announce registration messages will be sent.
-
- See also announce_port and announce_file
-DOC_END
-
-NAME: announce_file
-TYPE: string
-DEFAULT: none
-LOC: Config.Announce.file
-DOC_START
- The contents of this file will be included in the announce
- registration messages.
-DOC_END
-
-NAME: announce_port
-TYPE: u_short
-DEFAULT: 3131
-LOC: Config.Announce.port
-DOC_START
- Set the port where announce registration messages will be sent.
-
- See also announce_host and announce_file
-DOC_END
-
COMMENT_START
HTTPD-ACCELERATOR OPTIONS
-----------------------------------------------------------------------------
#include "refresh.h"
#include "sbuf/Stream.h"
#include "SBufStatsAction.h"
-#include "send-announce.h"
#include "SquidConfig.h"
#include "stat.h"
#include "StatCounters.h"
Config.ClientDelay.finalize();
#endif
- if (Config.onoff.announce) {
- if (!eventFind(start_announce, nullptr))
- eventAdd("start_announce", start_announce, nullptr, 3600.0, 1);
- } else {
- if (eventFind(start_announce, nullptr))
- eventDelete(start_announce, nullptr);
- }
-
reconfiguring = 0;
}
eventAdd("storeMaintain", Store::Maintain, nullptr, 1.0, 1);
- if (Config.onoff.announce)
- eventAdd("start_announce", start_announce, nullptr, 3600.0, 1);
-
eventAdd("ipcache_purgelru", ipcache_purgelru, nullptr, 10.0, 1);
eventAdd("fqdncache_purgelru", fqdncache_purgelru, nullptr, 15.0, 1);
+++ /dev/null
-/*
- * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
- *
- * Squid software is distributed under GPLv2+ license and includes
- * contributions from numerous individuals and organizations.
- * Please see the COPYING and CONTRIBUTORS files for details.
- */
-
-/* DEBUG: section 27 Cache Announcer */
-
-#include "squid.h"
-#include "anyp/PortCfg.h"
-#include "comm/Connection.h"
-#include "event.h"
-#include "fd.h"
-#include "fde.h"
-#include "fs_io.h"
-#include "globals.h"
-#include "ICP.h"
-#include "ipcache.h"
-#include "send-announce.h"
-#include "SquidConfig.h"
-#include "tools.h"
-
-static IPH send_announce;
-
-void
-start_announce(void *)
-{
- if (0 == Config.onoff.announce)
- return;
-
- if (!Comm::IsConnOpen(icpOutgoingConn))
- return;
-
- ipcache_nbgethostbyname(Config.Announce.host, send_announce, nullptr);
-
- eventAdd("send_announce", start_announce, nullptr, (double) Config.Announce.period, 1);
-}
-
-static void
-send_announce(const ipcache_addrs *ia, const Dns::LookupDetails &, void *)
-{
- LOCAL_ARRAY(char, tbuf, 256);
- LOCAL_ARRAY(char, sndbuf, BUFSIZ);
-
- char *host = Config.Announce.host;
- char *file = nullptr;
- unsigned short port = Config.Announce.port;
- int l;
- int n;
- int fd;
-
- if (ia == nullptr) {
- debugs(27, DBG_IMPORTANT, "ERROR: send_announce: Unknown host '" << host << "'");
- return;
- }
-
- debugs(27, DBG_IMPORTANT, "Sending Announcement to " << host);
- sndbuf[0] = '\0';
- snprintf(tbuf, 256, "cache_version SQUID/%s\n", version_string);
- strcat(sndbuf, tbuf);
- assert(HttpPortList != nullptr);
- snprintf(tbuf, 256, "Running on %s %d %d\n",
- getMyHostname(),
- getMyPort(),
- (int) Config.Port.icp);
- strcat(sndbuf, tbuf);
-
- if (Config.adminEmail) {
- snprintf(tbuf, 256, "cache_admin: %s\n", Config.adminEmail);
- strcat(sndbuf, tbuf);
- }
-
- snprintf(tbuf, 256, "generated %d [%s]\n",
- (int) squid_curtime,
- Time::FormatHttpd(squid_curtime));
- strcat(sndbuf, tbuf);
- l = strlen(sndbuf);
-
- if ((file = Config.Announce.file) != nullptr) {
- fd = file_open(file, O_RDONLY | O_TEXT);
-
- if (fd > -1 && (n = FD_READ_METHOD(fd, sndbuf + l, BUFSIZ - l - 1)) > 0) {
- fd_bytes(fd, n, FD_READ);
- l += n;
- sndbuf[l] = '\0';
- file_close(fd);
- } else {
- int xerrno = errno;
- debugs(50, DBG_IMPORTANT, "send_announce: " << file << ": " << xstrerr(xerrno));
- }
- }
-
- Ip::Address S = ia->current();
- S.port(port);
- assert(Comm::IsConnOpen(icpOutgoingConn));
-
- if (comm_udp_sendto(icpOutgoingConn->fd, S, sndbuf, strlen(sndbuf) + 1) < 0) {
- int xerrno = errno;
- debugs(27, DBG_IMPORTANT, "ERROR: Failed to announce to " << S << " from " << icpOutgoingConn->local << ": " << xstrerr(xerrno));
- }
-}
-
+++ /dev/null
-/*
- * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
- *
- * Squid software is distributed under GPLv2+ license and includes
- * contributions from numerous individuals and organizations.
- * Please see the COPYING and CONTRIBUTORS files for details.
- */
-
-/* DEBUG: section 27 Cache Announcer */
-
-#ifndef SQUID_SEND_ANNOUNCE_H_
-#define SQUID_SEND_ANNOUNCE_H_
-
-void start_announce(void *unused);
-
-#endif /* SQUID_SEND_ANNOUNCE_H_ */
-