From: wessels <> Date: Sat, 28 Mar 1998 01:41:12 +0000 (+0000) Subject: Fix announcment sending. Can't have NULL callback data I guess. X-Git-Tag: SQUID_3_0_PRE1~3736 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61735fcf73790b65cfb702202028545ddd4a7bc7;p=thirdparty%2Fsquid.git Fix announcment sending. Can't have NULL callback data I guess. Also, don't require that announce_file be non-null and exist. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index db044696e6..f3a36376e6 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.263 1998/03/25 09:21:43 kostas Exp $ + * $Id: cache_cf.cc,v 1.264 1998/03/27 18:41:13 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -272,7 +272,6 @@ configDoConfigure(void) requirePathnameExists("unlinkd_program", Config.Program.unlinkd); if (Config.Program.redirect) requirePathnameExists("redirect_program", Config.Program.redirect); - requirePathnameExists("announce_file", Config.Announce.file); requirePathnameExists("Icon Directory", Config.icons.directory); requirePathnameExists("Error Directory", Config.errorDirectory); } diff --git a/src/cf.data.pre b/src/cf.data.pre index b096dc6aef..7d9fcd67ad 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1404,13 +1404,13 @@ DOC_END NAME: announce_host TYPE: string -DEFAULT: sd.cache.nlanr.net +DEFAULT: tracker.ircache.net LOC: Config.Announce.host DOC_NONE NAME: announce_file TYPE: string -DEFAULT: /dev/null +DEFAULT: none LOC: Config.Announce.file DOC_NONE @@ -1422,13 +1422,12 @@ DOC_START announce_host and announce_port set the hostname and portnumber where the registration message will be sent. - Hostname will default to 'sd.cache.nlanr.net' and port will default + Hostname will default to 'tracker.ircache.net' and port will default to 3131. If the 'filename' argument is given, the contents of that file will be included in the announce message. -announce_host sd.cache.nlanr.net +announce_host tracker.ircache.net announce_port 3131 -announce_file /dev/null DOC_END COMMENT_START diff --git a/src/send-announce.cc b/src/send-announce.cc index 730bef06e0..37ac82818b 100644 --- a/src/send-announce.cc +++ b/src/send-announce.cc @@ -1,6 +1,6 @@ /* - * $Id: send-announce.cc,v 1.47 1998/03/23 22:07:28 wessels Exp $ + * $Id: send-announce.cc,v 1.48 1998/03/27 18:41:14 wessels Exp $ * * DEBUG: section 27 Cache Announcer * AUTHOR: Duane Wessels @@ -36,14 +36,16 @@ static IPH send_announce; void start_announce(void *datanotused) { + void *junk; if (0 == Config.onoff.announce) return; - ipcache_nbgethostbyname(Config.Announce.host, send_announce, NULL); + cbdataAdd(junk = xmalloc(1), MEM_NONE); + ipcache_nbgethostbyname(Config.Announce.host, send_announce, junk); eventAdd("send_announce", start_announce, NULL, Config.Announce.period); } static void -send_announce(const ipcache_addrs * ia, void *datanotused) +send_announce(const ipcache_addrs * ia, void *junk) { LOCAL_ARRAY(char, tbuf, 256); LOCAL_ARRAY(char, sndbuf, BUFSIZ); @@ -54,6 +56,7 @@ send_announce(const ipcache_addrs * ia, void *datanotused) int l; int n; int fd; + cbdataFree(junk); if (ia == NULL) { debug(27, 1) ("send_announce: Unknown host '%s'\n", host); return;