? .hg
? 2010.08.03
? 25
? SQLServerIntroduction.docx.ps
? aclocal.m4
? allow_insane_bans.patch
? autom4te.cache
? bcn.ircd.motd
? cache
? config.settings.bac
? config.settings.system
? config.status.2010.12.20
? gwz-windows-loadmodule-patch2.patch
? gwz-windows-nogencert.patch
? hidle.patch
? ircd.log
? ircd.pid
? ircd.tune
? location.conf
? motd.txt
? nopost-1.1
? nopost.tar.gz
? patch1.patch
? robots.txt
? server.cert.pem
? server.key.pem
? server.req.pem
? smotd.txt
? unreal-makefile-cleaner-recursive.patch
? unreal-poll.diff
? unrealircd.conf
? valgrind.unreal.suppress
? doc/AntiRandom
? extras/c-ares
? extras/c-ares-1.6.0
? extras/c-ares-1.7.3
? extras/c-ares-1.7.3.tar.gz.asc
? extras/c-ares.tar
? extras/regexp
? extras/tre-0.7.5
? extras/tre-0.8.0
? extras/tre.tar
? ircdcron/ircd.cron
? src/modules/antirandom.c
? src/modules/callerid.c
? src/modules/m_dnsbl.tar.gz
? src/modules/m_gqline.c
? src/modules/m_soper.c
? src/modules/nopost-1.1
? src/modules/nopost.tar.gz
? src/modules/testchanmodehook.c
Index: include/struct.h
===================================================================
RCS file: /cvs/unreal/include/struct.h,v
retrieving revision 1.1.1.1.6.1.2.261.2.57
diff -u -B -r1.1.1.1.6.1.2.261.2.57 struct.h
--- include/struct.h	12 Dec 2010 17:08:22 -0000	1.1.1.1.6.1.2.261.2.57
+++ include/struct.h	24 Dec 2010 23:24:13 -0000
@@ -724,7 +724,6 @@
 struct MotdDownload
 {
 	struct Motd *themotd;
-	char url_filename[PATH_MAX+1]; /*< Where the downloaded file should be stored */
 };
 #endif /* USE_LIBCURL */
 
Index: src/s_serv.c
===================================================================
RCS file: /cvs/unreal/src/s_serv.c,v
retrieving revision 1.1.1.1.6.1.2.299.2.43
diff -u -B -r1.1.1.1.6.1.2.299.2.43 s_serv.c
--- src/s_serv.c	12 Dec 2010 21:13:43 -0000	1.1.1.1.6.1.2.299.2.43
+++ src/s_serv.c	24 Dec 2010 23:24:13 -0000
@@ -1001,12 +1001,11 @@
 		motd_download->themotd = themotd;
 		themotd->motd_download = motd_download;
 
-		/* determine where to the MOTD should be stored after it's downloaded */
-		url_filename = url_getfilename(filename);
-		strlcpy(motd_download->url_filename, url_filename, sizeof(motd_download->url_filename));
-		motd_download->url_filename[PATH_MAX] = '\0';
-
-		modtime = unreal_getfilemodtime(url_filename);
+#ifdef REMOTEINC_SPECIALCACHE
+		modtime = unreal_getfilemodtime(unreal_mkcache(filename));
+#else
+		modtime = 0;
+#endif
 
 		MyFree(url_filename);
 
@@ -1033,6 +1032,8 @@
 {
 	aMotdFile *themotd;
 
+	char *tmpfile;
+
 	themotd = motd_download->themotd;
 	/*
 	  check if the download was soft-canceled. See struct.h's docs on
@@ -1050,10 +1051,8 @@
 #ifdef REMOTEINC_SPECIALCACHE
 		if(has_cached_version(url))
 		{
-			
-			config_warn("Error downloading MOTD file from \"%s\": %s", url, errorbuf);
-			filename = motd_download->url_filename;
-			unreal_copyfileex(unreal_mkcache(url), filename, 0);
+			config_warn("Error downloading MOTD file from \"%s\": %s -- using cached version instead.", url, errorbuf);
+			filename = unreal_mkcache(url);
 		} else {
 #endif
 			config_error("Error downloading MOTD file from \"%s\": %s", url, errorbuf);
@@ -1064,24 +1063,23 @@
 #endif
 	}
 
+#ifdef REMOTEINC_SPECIALCACHE
 	/*
-	  We need to move our newly downloaded file to the place specified
-	  by url_filename if it's not cached.
-	*/
+	 * We need to move our newly downloaded file to its cache file
+	 * if it isn't there already.
+	 */
 	if(!cached)
 	{
-		unreal_copyfileex(filename, motd_download->url_filename, 0);
-#ifdef REMOTEINC_SPECIALCACHE
 		/* create specialcached version for later */
 		unreal_copyfileex(filename, unreal_mkcache(url), 1);
-#endif
 	} else {
 		/*
-		  The file is cached. Thus we must look for it at
-		  motd_download->url_filename, where be placed it earlier.
+		 * The file is cached. Thus we must look for it at the
+		 * cache location where we placed it earlier.
 		 */
-		filename = motd_download->url_filename;
+		filename = unreal_mkcache(url);
 	}
+#endif
 
 	do_read_motd(filename, themotd);
 	MyFree(motd_download);
