From 636a52312b9ba4c5ffc886c7bdba14bd76726976 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 20 Sep 2008 21:46:56 +0000 Subject: Fix a rather nasty race condition revealed by my reading through the comments and enhancing them. Back when i did executeable includes, i placed a 'todo' in the code which said something along the lines of: 'we cant pass a User* into the config reader any more, because when the config reader thread finishes, that user may be gone and this will crash. Consider using an UID instead so that if the user vanishes, we can detect this situation.' Of course, nobody ever did this, so i'm doing it now to ensure we dont come up against some particularly ugly race condition crashes! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10569 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/configreader.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/configreader.h') diff --git a/include/configreader.h b/include/configreader.h index 1bd6766be..31551dedb 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -335,7 +335,7 @@ class CoreExport ServerConfig : public Extensible /** User that is currently performing a rehash, needed because the * rehash code is now threaded and needs to know who to give errors and feedback to. */ - User* RehashUser; + std::string RehashUserUID; /** Rehash parameter, as above */ @@ -780,7 +780,7 @@ class CoreExport ServerConfig : public Extensible * and initialize this class. All other methods * should be used only by the core. */ - void Read(bool bail, User* user); + void Read(bool bail, const std::string &useruid); /** Read a file into a file_cache object */ @@ -796,7 +796,7 @@ class CoreExport ServerConfig : public Extensible * this user as SNOTICEs. * If the parameter is NULL, the messages are spooled to all opers. */ - void ReportConfigError(const std::string &errormessage, bool bail, User* user); + void ReportConfigError(const std::string &errormessage, bool bail, const std::string &useruid); /** Load 'filename' into 'target', with the new config parser everything is parsed into * tag/key/value at load-time rather than at read-value time. -- cgit v1.2.3