From 380852d1a7393ee7ca0ae9f45751ab1fb307f0d0 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 18 Nov 2007 10:25:12 +0000 Subject: First part of stuff for remote includes (this doesnt work yet) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8601 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 42 +++++++----------------------------------- 1 file changed, 7 insertions(+), 35 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 47c8ec234..5b2cdd9d4 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -1256,42 +1256,10 @@ void ServerConfig::Read(bool bail, User* user, int pass) ServerInstance->WriteOpers("*** Successfully rehashed server."); } -bool ServerConfig::Downloading() +/* XXX: This can and will block! */ +void ServerConfig::DoDownloads() { - if (isatty(0) && isatty(1) && isatty(2)) - { - printf("."); - fflush(stdout); - } - - ServerInstance->Log(DEBUG, "ServerConfig::Downloading %d %d", TotalDownloaded, IncludedFiles.size()); - - /* Returns true if there are still files in the process of downloading */ - return (TotalDownloaded < IncludedFiles.size()); -} - -void ServerConfig::Complete(const std::string &filename, bool error) -{ - ServerInstance->Log(DEBUG,"Flag complete: %s %d", filename.c_str(), error); - std::map::iterator x = IncludedFiles.find(filename); - - if (x != IncludedFiles.end()) - { - if (error) - { - delete x->second; - x->second = NULL; - FileErrors++; - } - TotalDownloaded++; - } - - return; -} - -void ServerConfig::StartDownloads() -{ - ServerInstance->Log(DEBUG,"((((((((((((((((((((((((( StartDownloads() size=%d )))))))))))))))))))))))))))))))))))))", IncludedFiles.size()); + ServerInstance->Log(DEBUG,"In DoDownloads()"); /* Reads all local files into the IncludedFiles map, then initiates sockets for the remote ones */ for (std::map::iterator x = IncludedFiles.begin(); x != IncludedFiles.end(); ++x) @@ -1340,6 +1308,10 @@ void ServerConfig::StartDownloads() delete x->second; x->second = NULL; } + else + { + /* Search new file here for more includes to parse */ + } } CompletedFiles[x->first] = true; } -- cgit v1.3.1-10-gc9f91