summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-18 10:25:12 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-18 10:25:12 +0000
commit380852d1a7393ee7ca0ae9f45751ab1fb307f0d0 (patch)
treed45f19f904ffd09489b6a8a621ecd3d477c250ad /src/configreader.cpp
parent12ec2bc108e0f0219792cbbe78a6ce7d86818fe3 (diff)
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
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp42
1 files changed, 7 insertions, 35 deletions
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<std::string, std::istream*>::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<std::string, std::istream*>::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;
}