From f209cce90b394acd26e22eacef0bff61e8f5b4e1 Mon Sep 17 00:00:00 2001 From: peavey Date: Sat, 14 Feb 2009 21:14:36 +0000 Subject: Nuke trailing spaces git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11105 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/base.h | 16 ++++---- include/command_parse.h | 3 +- include/commands/cmd_whowas.h | 2 +- include/configreader.h | 30 +++++++------- include/ctables.h | 3 +- include/dynamic.h | 20 +++++----- include/hash_map.h | 7 +--- include/hashcomp.h | 27 +++++++------ include/inspircd.h | 2 +- include/inspsocket.h | 3 +- include/mode.h | 9 ++--- include/modules.h | 46 +++++++++++----------- include/numerics.h | 4 +- include/socketengines/socketengine_iocp.h | 7 ++-- include/threadengines/threadengine_pthread.h | 2 +- include/u_listmode.h | 25 ++++++------ include/usermanager.h | 4 +- include/users.h | 17 ++++---- include/xline.h | 13 +++---- make/opensslcert.pm | 2 +- src/channels.cpp | 2 +- src/command_parse.cpp | 8 ++-- src/commands.cpp | 16 ++++---- src/commands/cmd_die.cpp | 2 +- src/commands/cmd_eline.cpp | 2 +- src/commands/cmd_gline.cpp | 3 +- src/commands/cmd_kline.cpp | 3 +- src/commands/cmd_notice.cpp | 5 +-- src/commands/cmd_oper.cpp | 3 +- src/commands/cmd_part.cpp | 2 +- src/commands/cmd_privmsg.cpp | 9 ++--- src/commands/cmd_reloadmodule.cpp | 2 +- src/commands/cmd_stats.cpp | 14 +++---- src/commands/cmd_userhost.cpp | 1 - src/commands/cmd_who.cpp | 9 ++--- src/commands/cmd_whowas.cpp | 8 ++-- src/commands/cmd_zline.cpp | 2 +- src/dns.cpp | 23 +++++------ src/dynamic.cpp | 4 +- src/hashcomp.cpp | 5 +-- src/helperfuncs.cpp | 11 ++---- src/inspircd.cpp | 16 ++++---- src/inspstring.cpp | 9 ++--- src/logger.cpp | 5 +-- src/modes/cmode_k.cpp | 3 +- src/modules.cpp | 24 ++++++------ src/modules/extra/m_sqloper.cpp | 1 - src/modules/extra/m_sqlutils.h | 14 +++---- src/modules/extra/m_ssl_gnutls.cpp | 8 ++-- src/modules/m_alias.cpp | 8 ++-- src/modules/m_chanprotect.cpp | 2 +- src/modules/m_dccallow.cpp | 7 ++-- src/modules/m_filter.cpp | 7 ++-- src/modules/m_operprefix.cpp | 5 +-- src/modules/m_override.cpp | 2 +- src/modules/m_regex.h | 2 +- src/modules/m_satopic.cpp | 2 +- src/modules/m_services_account.cpp | 2 +- src/modules/m_servprotect.cpp | 2 +- src/modules/m_spanningtree/treeserver.cpp | 2 - src/modules/m_spanningtree/treeserver.h | 6 +-- src/modules/m_spanningtree/treesocket2.cpp | 4 +- src/modules/rpc.h | 58 ++++++++++++++-------------- src/modules/transport.h | 3 +- src/server.cpp | 2 +- src/snomasks.cpp | 2 +- src/socket.cpp | 6 +-- src/socketengine.cpp | 2 +- src/socketengines/socketengine_iocp.cpp | 14 +++---- src/socketengines/socketengine_kqueue.cpp | 2 +- src/timer.cpp | 4 +- src/user_resolver.cpp | 2 +- src/usermanager.cpp | 5 +-- src/users.cpp | 23 ++++++----- src/xline.cpp | 13 +++---- 75 files changed, 295 insertions(+), 348 deletions(-) diff --git a/include/base.h b/include/base.h index 3a26b1be8..4dbddf97f 100644 --- a/include/base.h +++ b/include/base.h @@ -11,8 +11,8 @@ * --------------------------------------------------- */ -#ifndef __BASE_H__ -#define __BASE_H__ +#ifndef __BASE_H__ +#define __BASE_H__ #include #include @@ -25,7 +25,7 @@ typedef std::map ExtensibleStore; * Wherever possible, all classes you create should inherit from this, * giving them the ability to be passed to various core functions * as 'anonymous' classes. -*/ +*/ class CoreExport classbase { public: @@ -57,7 +57,7 @@ class CoreExport Extensible : public classbase * Holds all extensible metadata for the class. */ ExtensibleStore Extension_Items; - + public: /** Extend an Extensible class. @@ -110,7 +110,7 @@ public: * @return Returns true on success. */ bool Shrink(const std::string &key); - + /** Get an extension item. * * @param key The key parameter is an arbitary string which identifies the extension data @@ -131,12 +131,12 @@ public: return false; } } - + /** Get an extension item. * * @param key The key parameter is an arbitary string which identifies the extension data * @return Returns true if the item was found and false if it was not. - * + * * This single-parameter version only checks if the key exists, it does nothing with * the 'data' field and is probably only useful in conjunction with the single-parameter * version of Extend(). @@ -205,7 +205,7 @@ class CoreExport BoolSet : public classbase /** OR two BoolSets together */ BoolSet operator|(BoolSet other); - + /** AND two BoolSets together */ BoolSet operator&(BoolSet other); diff --git a/include/command_parse.h b/include/command_parse.h index c2606a97d..b3ae3236a 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -118,7 +118,7 @@ class CoreExport CommandParser : public classbase * function will return true, otherwise it will return false. */ bool IsValidCommand(const std::string &commandname, unsigned int pcnt, User * user); - + /** LoopCall is used to call a command classes handler repeatedly based on the contents of a comma seperated list. * There are two overriden versions of this method, one of which takes two potential lists and the other takes one. * We need a version which takes two potential lists for JOIN, because a JOIN may contain two lists of items at once, @@ -246,4 +246,3 @@ const int duration_multi[] = }; #endif - diff --git a/include/commands/cmd_whowas.h b/include/commands/cmd_whowas.h index ba1a75ea9..bc20e893c 100644 --- a/include/commands/cmd_whowas.h +++ b/include/commands/cmd_whowas.h @@ -62,7 +62,7 @@ class CommandWhowas : public Command /** Whowas container, contains a map of vectors of users tracked by WHOWAS */ whowas_users whowas; - + /** Whowas container, contains a map of time_t to users tracked by WHOWAS */ whowas_users_fifo whowas_fifo; diff --git a/include/configreader.h b/include/configreader.h index 02defab63..787bcb243 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -17,7 +17,7 @@ /* handy defines */ /** Determines if a channel op is exempt from given mode m, - * in config of server instance s. + * in config of server instance s. */ #define CHANOPS_EXEMPT(s, m) (s->Config->ExemptChanOps[(unsigned char)m]) @@ -373,7 +373,7 @@ class CoreExport ServerConfig : public Extensible /** Not used any more as it is named, can probably be removed or renamed. */ int DoDownloads(); - + /** This holds all the information in the config file, * it's indexed by tag name to a vector of key/values. */ @@ -419,7 +419,7 @@ class CoreExport ServerConfig : public Extensible /** Notice to give to users when they are Xlined */ char MoronBanner[MAXBUF]; - + /* Holds the network name the local server * belongs to. This is an arbitary field defined * by the administrator. @@ -546,7 +546,7 @@ class CoreExport ServerConfig : public Extensible * foreground. */ bool nofork; - + /** If this value if true then all log * messages will be output, regardless of * the level given in the config file. @@ -554,7 +554,7 @@ class CoreExport ServerConfig : public Extensible * option. */ bool forcedebug; - + /** If this is true then log output will be * written to the logfile. This is the default. * If you put -nolog on the commandline then @@ -694,7 +694,7 @@ class CoreExport ServerConfig : public Extensible * only to operators. */ char UserStats[MAXBUF]; - + /** The path and filename of the ircd.log file */ std::string logpath; @@ -829,7 +829,7 @@ class CoreExport ServerConfig : public Extensible * tag/key/value at load-time rather than at read-value time. */ bool LoadConf(ConfigDataHash &target, FILE* &conf, const std::string &filename, std::ostringstream &errorstream); - + /** Writes 'length' chars into 'result' as a string */ bool ConfValue(ConfigDataHash &target, const char* tag, const char* var, int index, char* result, int length, bool allow_linefeeds = false); @@ -845,7 +845,7 @@ class CoreExport ServerConfig : public Extensible /** Writes 'length' chars into 'result' as a string */ bool ConfValue(ConfigDataHash &target, const std::string &tag, const std::string &var, const std::string &default_value, int index, std::string &result, bool allow_linefeeds = false); - + /** Tries to convert the value to an integer and write it to 'result' */ bool ConfValueInteger(ConfigDataHash &target, const char* tag, const char* var, int index, int &result); @@ -861,7 +861,7 @@ class CoreExport ServerConfig : public Extensible /** Tries to convert the value to an integer and write it to 'result' */ bool ConfValueInteger(ConfigDataHash &target, const std::string &tag, const std::string &var, const std::string &default_value, int index, int &result); - + /** Returns true if the value exists and has a true value, false otherwise */ bool ConfValueBool(ConfigDataHash &target, const char* tag, const char* var, int index); @@ -877,14 +877,14 @@ class CoreExport ServerConfig : public Extensible /** Returns true if the value exists and has a true value, false otherwise */ bool ConfValueBool(ConfigDataHash &target, const std::string &tag, const std::string &var, const std::string &default_value, int index); - + /** Returns the number of occurences of tag in the config file */ int ConfValueEnum(ConfigDataHash &target, const char* tag); /** Returns the number of occurences of tag in the config file */ int ConfValueEnum(ConfigDataHash &target, const std::string &tag); - + /** Returns the numbers of vars inside the index'th 'tag in the config file */ int ConfVarEnum(ConfigDataHash &target, const char* tag, int index); @@ -945,7 +945,7 @@ bool InitTypes(ServerConfig* conf, const char* tag); */ bool InitClasses(ServerConfig* conf, const char* tag); -/** Initialize an oper type +/** Initialize an oper type */ bool DoType(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types); @@ -962,7 +962,7 @@ bool DoneClassesAndTypes(ServerConfig* conf, const char* tag); /** Initialize x line */ bool InitXLine(ServerConfig* conf, const char* tag); - + /** Add a config-defined zline */ bool DoZLine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types); @@ -979,8 +979,4 @@ bool DoKLine(ServerConfig* conf, const char* tag, char** entries, ValueList &val */ bool DoELine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types); - - - #endif - diff --git a/include/ctables.h b/include/ctables.h index 7ff47abbf..3e10e7c23 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -10,7 +10,7 @@ * * --------------------------------------------------- */ - + #ifndef __CTABLES_H__ #define __CTABLES_H__ @@ -243,4 +243,3 @@ typedef nspace::hash_map Commandtable; translation.push_back(x5);translation.push_back(x6);translation.push_back(x7);translation.push_back(x8); #endif - diff --git a/include/dynamic.h b/include/dynamic.h index e910603f7..b48eaeacd 100644 --- a/include/dynamic.h +++ b/include/dynamic.h @@ -24,7 +24,7 @@ class CoreExport DLLManager /** The last error string, or NULL */ const char *err; - + public: /** This constructor loads the module using dlopen() * @param ServerInstance The creator class of this object @@ -65,7 +65,7 @@ class CoreExport LoadModuleException : public CoreException : CoreException(message, "the core") { } - + /** This destructor solves world hunger, cancels the world debt, and causes the world to end. * Actually no, it does nothing. Never mind. * @throws Nothing! @@ -82,7 +82,7 @@ class CoreExport FindSymbolException : public CoreException : CoreException(message, "the core") { } - + /** This destructor solves world hunger, cancels the world debt, and causes the world to end. * Actually no, it does nothing. Never mind. * @throws Nothing! @@ -102,8 +102,8 @@ template class CoreExport DLLFactory : public DLLManager * The init_module function is the only exported extern "C" declaration * in any module file. In a cmd_*.cpp file the equivilant is init_command */ - typedef ReturnType * (initfunctype) (InspIRCd*); - + typedef ReturnType * (initfunctype) (InspIRCd*); + /** Pointer to the init function. */ initfunctype* init_func; @@ -111,7 +111,7 @@ template class CoreExport DLLFactory : public DLLManager /** Instance pointer to be passed to init_*() when it is called. */ InspIRCd* ServerInstance; - + public: /** Default constructor. * This constructor passes its paramerers down through DLLFactoryBase and then DLLManager @@ -121,9 +121,9 @@ template class CoreExport DLLFactory : public DLLManager */ DLLFactory(InspIRCd* Instance, const char *fname, const char *func_name) : DLLManager(Instance, fname), init_func(NULL), ServerInstance(Instance) - { + { const char* error = LastError(); - + if(!error) { if(!GetSymbol((void **)&init_func, func_name)) @@ -136,7 +136,7 @@ template class CoreExport DLLFactory : public DLLManager throw LoadModuleException(error); } } - + /** Calls the 'init_module' C exported function within a module, which * returns a pointer to a Module derived object. */ @@ -151,7 +151,7 @@ template class CoreExport DLLFactory : public DLLManager return NULL; } } - + /** The destructor deletes the ModuleFactory pointer. */ ~DLLFactory() diff --git a/include/hash_map.h b/include/hash_map.h index 0da5c7433..f49b6a68b 100644 --- a/include/hash_map.h +++ b/include/hash_map.h @@ -10,7 +10,7 @@ * * --------------------------------------------------- */ - + #ifndef INSPIRCD_HASHMAP_H #define INSPIRCD_HASHMAP_H @@ -31,7 +31,7 @@ #define hash_map unordered_map #define nspace std::tr1 #define BEGIN_HASHMAP_NAMESPACE namespace std { namespace tr1 { - #define END_HASHMAP_NAMESPACE } } + #define END_HASHMAP_NAMESPACE } } #endif #else #include @@ -42,7 +42,4 @@ #define END_HASHMAP_NAMESPACE } #endif - - #endif - diff --git a/include/hashcomp.h b/include/hashcomp.h index eaafef2c6..a1bc26602 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -288,15 +288,15 @@ namespace irc * @param modeletter The mode letter to insert */ void Push(char modeletter); - + /** Push a '+' symbol onto the stack. */ void PushPlus(); - + /** Push a '-' symbol onto the stack. */ void PushMinus(); - + /** Return zero or more elements which form the * mode line. This will be clamped to a max of * MAXMODES items (MAXMODES-1 mode parameters and @@ -331,7 +331,7 @@ namespace irc class CoreExport tokenstream : public classbase { private: - + /** Original string */ std::string tokens; @@ -467,43 +467,43 @@ namespace irc /** Used to split on commas */ commasepstream* sep; - + /** Current position in a range of ports */ long in_range; - + /** Starting port in a range of ports */ long range_begin; - + /** Ending port in a range of ports */ long range_end; - + /** Allow overlapped port ranges */ bool overlapped; - + /** Used to determine overlapping of ports * without O(n) algorithm being used */ std::map overlap_set; - + /** Returns true if val overlaps an existing range */ bool Overlaps(long val); public: - + /** Create a portparser and fill it with the provided data * @param source The source text to parse from * @param allow_overlapped Allow overlapped ranges */ portparser(const std::string &source, bool allow_overlapped = true); - + /** Frees the internal commasepstream object */ ~portparser(); - + /** Fetch the next token from the stream * @return The next port number is returned, or 0 if none remain */ @@ -703,4 +703,3 @@ BEGIN_HASHMAP_NAMESPACE END_HASHMAP_NAMESPACE #endif - diff --git a/include/inspircd.h b/include/inspircd.h index 40f9c23f4..fcd6849d5 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -17,7 +17,7 @@ #define _FILE_OFFSET_BITS 64 #ifndef _LARGEFILE_SOURCE #define _LARGEFILE_SOURCE -#endif +#endif #ifndef WIN32 #define DllExport diff --git a/include/inspsocket.h b/include/inspsocket.h index 9d5375f8c..43903ae97 100644 --- a/include/inspsocket.h +++ b/include/inspsocket.h @@ -236,7 +236,7 @@ class CoreExport BufferedSocket : public EventHandler virtual bool OnDataReady(); /** - * When it is ok to write to the socket, and a + * When it is ok to write to the socket, and a * write event was requested, this method is * triggered. * @@ -345,4 +345,3 @@ class CoreExport BufferedSocket : public EventHandler }; #endif - diff --git a/include/mode.h b/include/mode.h index 84085a913..f78fcda9c 100644 --- a/include/mode.h +++ b/include/mode.h @@ -460,17 +460,17 @@ class CoreExport ModeParser : public classbase * E.g. * * nick -> nick!*@* - * + * * nick!ident -> nick!ident@* - * + * * host.name -> *!*@host.name - * + * * ident@host.name -> *!ident@host.name * * This method can be used on both IPV4 and IPV6 user masks. */ static void CleanMask(std::string &mask); - /** Get the last string to be processed, as it was sent to the user or channel. + /** Get the last string to be processed, as it was sent to the user or channel. * Use this to display a string you just sent to be parsed, as the actual output * may be different to what you sent after it has been 'cleaned up' by the parser. * @return Last parsed string, as seen by users. @@ -574,4 +574,3 @@ class CoreExport ModeParser : public classbase }; #endif - diff --git a/include/modules.h b/include/modules.h index 5d4b24631..64eb3cfd1 100644 --- a/include/modules.h +++ b/include/modules.h @@ -395,7 +395,7 @@ enum Implementation I_OnDecodeMetaData, I_ProtoSendMode, I_ProtoSendMetaData, I_OnWallops, I_OnChangeHost, I_OnChangeName, I_OnAddLine, I_OnDelLine, I_OnExpireLine, I_OnCleanup, I_OnUserPostNick, I_OnAccessCheck, I_On005Numeric, I_OnKill, I_OnRemoteKill, I_OnLoadModule, I_OnUnloadModule, I_OnBackgroundTimer, I_OnPreCommand, I_OnCheckReady, I_OnCheckInvite, I_OnRawMode, - I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnCheckExtBan, I_OnCheckStringExtBan, I_OnStats, I_OnChangeLocalUserHost, I_OnChangeLocalUserGecos, + I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnCheckExtBan, I_OnCheckStringExtBan, I_OnStats, I_OnChangeLocalUserHost, I_OnChangeLocalUserGecos, I_OnLocalTopicChange, I_OnPostLocalTopicChange, I_OnEvent, I_OnRequest, I_OnGlobalOper, I_OnPostConnect, I_OnAddBan, I_OnDelBan, I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketWrite, I_OnRawSocketRead, I_OnChangeLocalUserGECOS, I_OnUserRegister, I_OnChannelPreDelete, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData, I_OnSetAway, I_OnUserList, @@ -548,7 +548,7 @@ class CoreExport Module : public Extensible * @return 1 To prevent the join, 0 to allow it. */ virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven); - + /** Called whenever a user is about to be kicked. * Returning a value of 1 from this function stops the process immediately, causing no * output to be sent to the user by the core. If you do this you must produce your own numerics, @@ -590,7 +590,7 @@ class CoreExport Module : public Extensible * @param opertype The opers type name */ virtual void OnPostOper(User* user, const std::string &opername, const std::string &opertype); - + /** Called whenever a user types /INFO. * The User will contain the information of the user who typed the command. Modules may use this * method to output their own credits in /INFO (which is the ircd's version of an about box). @@ -602,7 +602,7 @@ class CoreExport Module : public Extensible * @param user The user issuing /INFO */ virtual void OnInfo(User* user); - + /** Called whenever a /WHOIS is performed on a local user. * The source parameter contains the details of the user who issued the WHOIS command, and * the dest parameter contains the information of the user they are whoising. @@ -610,7 +610,7 @@ class CoreExport Module : public Extensible * @param dest The user who is being WHOISed */ virtual void OnWhois(User* source, User* dest); - + /** Called whenever a user is about to invite another user into a channel, before any processing is done. * Returning 1 from this function stops the process immediately, causing no * output to be sent to the user by the core. If you do this you must produce your own numerics, @@ -622,7 +622,7 @@ class CoreExport Module : public Extensible * @return 1 to deny the invite, 0 to check whether or not the user has permission to invite, -1 to explicitly allow the invite */ virtual int OnUserPreInvite(User* source,User* dest,Channel* channel, time_t timeout); - + /** Called after a user has been successfully invited to a channel. * You cannot prevent the invite from occuring using this function, to do that, * use OnUserPreInvite instead. @@ -632,7 +632,7 @@ class CoreExport Module : public Extensible * @param timeout The time the invite will expire (0 == never) */ virtual void OnUserInvite(User* source,User* dest,Channel* channel, time_t timeout); - + /** Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done. * Returning any nonzero value from this function stops the process immediately, causing no * output to be sent to the user by the core. If you do this you must produce your own numerics, @@ -682,7 +682,7 @@ class CoreExport Module : public Extensible * @param text The original message text causing the exempt list to be built */ virtual void OnBuildExemptList(MessageType message_type, Channel* chan, User* sender, char status, CUList &exempt_list, const std::string &text); - + /** Called before any nickchange, local or remote. This can be used to implement Q-lines etc. * Please note that although you can see remote nickchanges through this function, you should * NOT make any changes to the User if the user is a remote user as this may cause a desnyc. @@ -865,7 +865,7 @@ class CoreExport Module : public Extensible * @param extdata Encoded data for this extension name, which will be encoded at the oppsite end by an identical module using OnDecodeMetaData */ virtual void ProtoSendMetaData(void* opaque, TargetTypeFlags target_type, void* target, const std::string &extname, const std::string &extdata); - + /** Called after every WALLOPS command. * @param user The user sending the WALLOPS * @param text The content of the WALLOPS message @@ -1170,7 +1170,7 @@ class CoreExport Module : public Extensible * @param newhost The new GECOS * @return 1 to deny the GECOS change, 0 to allow */ - virtual int OnChangeLocalUserGECOS(User* user, const std::string &newhost); + virtual int OnChangeLocalUserGECOS(User* user, const std::string &newhost); /** Called whenever a topic is changed by a local user. * Return 1 to deny the topic change, 0 to check details on the change, -1 to let it through with no checks @@ -1416,7 +1416,7 @@ class CoreExport ConfigReader : public classbase /** Error code */ long error; - + public: /** Default constructor. * This constructor initialises the ConfigReader class to read the inspircd.conf file @@ -1571,7 +1571,7 @@ class CoreExport FileReader : public classbase * This function will return false if the file could not be opened. */ bool Exists(); - + /** Retrieve one line from the file. * This method retrieves one line from the text file. If an empty non-NULL string is returned, * the index was out of bounds, or the line had no data on it. @@ -1622,7 +1622,7 @@ class CoreExport ModuleManager : public classbase /** Holds a string describing the last module error to occur */ std::string LastModuleError; - + /** The feature names published by various modules */ featurelist Features; @@ -1630,11 +1630,11 @@ class CoreExport ModuleManager : public classbase /** The interface names published by various modules */ interfacelist Interfaces; - + /** Total number of modules loaded into the ircd */ - int ModCount; - + int ModCount; + /** Our pointer to the main insp instance */ InspIRCd* Instance; @@ -1657,7 +1657,7 @@ class CoreExport ModuleManager : public classbase /** Destructor */ - ~ModuleManager(); + ~ModuleManager(); /** Change the priority of one event in a module. * Each module event has a list of modules which are attached to that event type. @@ -1672,7 +1672,7 @@ class CoreExport ModuleManager : public classbase * set it to be the last called, or PRIO_BEFORE and PRIO_AFTER * to set it to be before or after one or more other modules. * @param modules If PRIO_BEFORE or PRIO_AFTER is set in parameter 's', - * then this contains a list of one or more modules your module must be + * then this contains a list of one or more modules your module must be * placed before or after. Your module will be placed before the highest * priority module in this list for PRIO_BEFORE, or after the lowest * priority module in this list for PRIO_AFTER. @@ -1720,7 +1720,7 @@ class CoreExport ModuleManager : public classbase * @param mod Module to detach from */ void DetachAll(Module* mod); - + /** Returns text describing the last module error * @return The last error message to occur */ @@ -1737,11 +1737,11 @@ class CoreExport ModuleManager : public classbase * @return True if the module was unloaded */ bool Unload(const char* filename); - + /** Called by the InspIRCd constructor to load all modules from the config file. */ void LoadAll(); - + /** Get the total number of currently loaded modules * @return The number of loaded modules */ @@ -1749,14 +1749,14 @@ class CoreExport ModuleManager : public classbase { return this->ModCount; } - + /** Find a module by name, and return a Module* to it. * This is preferred over iterating the module lists yourself. * @param name The module name to look up * @return A pointer to the module, or NULL if the module cannot be found */ Module* Find(const std::string &name); - + /** Publish a 'feature'. * There are two ways for a module to find another module it depends on. * Either by name, using InspIRCd::FindModule, or by feature, using this diff --git a/include/numerics.h b/include/numerics.h index 11cd3b1e1..76c5282a3 100644 --- a/include/numerics.h +++ b/include/numerics.h @@ -1,7 +1,7 @@ /* +------------------------------------+ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ - * + * * InspIRCd: (C) 2002-2009 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * @@ -128,7 +128,7 @@ enum Numerics ERR_NOPRIVILEGES = 481, // rfc, beware though, we use this for other things opers may not do also ERR_CHANOPRIVSNEEDED = 482, // rfc, beware though, we use this for other things like trying to kick a uline - ERR_ALLMUSTSSL = 490, // unrealircd + ERR_ALLMUSTSSL = 490, // unrealircd ERR_NOCTCPALLOWED = 492, // XXX: bzzzz. 1459 defines this as ERR_NOSERVICEHOST, research it more and perhaps change this! (ERR_CANNOTSENDTOCHAN?) // wtf, we also use this for m_noinvite. UGLY! ERR_DELAYREJOIN = 495, // insp-specific, XXX: we should use 'resource temporarily unavailable' from ircnet/ratbox or whatever diff --git a/include/socketengines/socketengine_iocp.h b/include/socketengines/socketengine_iocp.h index 95aa029d8..97d78397b 100644 --- a/include/socketengines/socketengine_iocp.h +++ b/include/socketengines/socketengine_iocp.h @@ -103,12 +103,12 @@ class IOCPEngine : public SocketEngine } return -1; } - + /** Global I/O completion port that sockets attach to. */ HANDLE m_completionPort; - /** This is kinda shitty... :/ for getting an address from a real fd. + /** This is kinda shitty... :/ for getting an address from a real fd. */ std::map m_binding; @@ -144,7 +144,7 @@ public: __inline int GetRemainingFds() { register int count = 0; - register int i = 0; + register int i = 0; for(; i < MAX_DESCRIPTORS; ++i) if(ref[i] == 0) ++count; @@ -238,4 +238,3 @@ public: }; #endif - diff --git a/include/threadengines/threadengine_pthread.h b/include/threadengines/threadengine_pthread.h index 0963f28f3..2d732cb5f 100644 --- a/include/threadengines/threadengine_pthread.h +++ b/include/threadengines/threadengine_pthread.h @@ -24,7 +24,7 @@ class InspIRCd; class CoreExport PThreadEngine : public ThreadEngine { private: - + bool Mutex(bool enable); public: diff --git a/include/u_listmode.h b/include/u_listmode.h index 666e851f7..b08ad8d4d 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -19,7 +19,7 @@ inline std::string stringtime(InspIRCd* Instance) { std::ostringstream TIME; - TIME << Instance->Time(); + TIME << Instance->Time(); return TIME.str(); } @@ -129,7 +129,7 @@ class ListModeBase : public ModeHandler * specified in ListModeBase::configtag */ limitlist chanlimits; - + public: /** Constructor. * @param Instance The creator of this class @@ -147,7 +147,7 @@ class ListModeBase : public ModeHandler infokey = "listbase_mode_" + std::string(1, mode) + "_list"; } - /** See mode.h + /** See mode.h */ std::pair ModeSet(User*, User*, Channel* channel, const std::string ¶meter) { @@ -222,7 +222,7 @@ class ListModeBase : public ModeHandler mode_junk.push_back(stackresult[j]); } - ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient); + ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient); } } } @@ -299,7 +299,7 @@ class ListModeBase : public ModeHandler { /* Give a subclass a chance to error about this */ TellAlreadyOnList(source, channel, parameter); - + // it does, deny the change return MODEACTION_DENY; } @@ -350,9 +350,9 @@ class ListModeBase : public ModeHandler { source->WriteNumeric(478, "%s %s %s :Channel ban/ignore list is full", source->nick.c_str(), channel->name.c_str(), parameter.c_str()); } - + parameter = ""; - return MODEACTION_DENY; + return MODEACTION_DENY; } else { @@ -445,7 +445,7 @@ class ListModeBase : public ModeHandler virtual void DoCleanup(int, void*) { } - + /** Validate parameters. * Overridden by implementing module. * @param source Source user adding the parameter @@ -457,7 +457,7 @@ class ListModeBase : public ModeHandler { return true; } - + /** Tell the user the list is too long. * Overridden by implementing module. * @param source Source user adding the parameter @@ -469,7 +469,7 @@ class ListModeBase : public ModeHandler { return false; } - + /** Tell the user an item is already on the list. * Overridden by implementing module. * @param source Source user adding the parameter @@ -479,7 +479,7 @@ class ListModeBase : public ModeHandler virtual void TellAlreadyOnList(User*, Channel*, std::string&) { } - + /** Tell the user that the parameter is not in the list. * Overridden by implementing module. * @param source Source user removing the parameter @@ -519,7 +519,7 @@ class ListModeBase : public ModeHandler { LM->literal = LM->user->nick + "!" + LM->user->ident + "@" + LM->user->GetIPString(); } - + for (modelist::iterator it = mlist->begin(); it != mlist->end(); it++) { if (LM->extban && it->mask.length() > 1 && it->mask[0] == LM->extban && it->mask[1] == ':') @@ -560,4 +560,3 @@ class ListModeBase : public ModeHandler }; #endif - diff --git a/include/usermanager.h b/include/usermanager.h index 452be27fe..bc0032696 100644 --- a/include/usermanager.h +++ b/include/usermanager.h @@ -31,7 +31,7 @@ class CoreExport UserManager : public Extensible UserManager(InspIRCd *Instance) : ServerInstance(Instance) { } - + ~UserManager() { for (user_hash::iterator i = clientlist->begin();i != clientlist->end();i++) @@ -99,7 +99,7 @@ class CoreExport UserManager : public Extensible void AddGlobalClone(User *user); /** Remove all clone counts from the user, you should - * use this if you change the user's IP address + * use this if you change the user's IP address * after they have registered. * @param user The user to remove */ diff --git a/include/users.h b/include/users.h index ab8e53b09..e723bb434 100644 --- a/include/users.h +++ b/include/users.h @@ -514,26 +514,26 @@ class CoreExport User : public EventHandler * Use InspIRCd::IsNick() to validate nicknames. */ std::string nick; - + /** The user's unique identifier. * This is the unique identifier which the user has across the network. */ std::string uuid; - + /** The users ident reply. * Two characters are added to the user-defined limit to compensate for the tilde etc. */ std::string ident; - + /** The host displayed to non-opers (used for cloaking etc). * This usually matches the value of User::host. */ std::string dhost; - + /** The users full name (GECOS). */ std::string fullname; - + /** The user's mode list. * NOT a null terminated string. * Also NOT an array. @@ -563,7 +563,7 @@ class CoreExport User : public EventHandler * If this string is empty, the user is not marked as away. */ std::string awaymsg; - + /** Time the user last went away. * This is ONLY RELIABLE if user IS_AWAY()! */ @@ -575,7 +575,7 @@ class CoreExport User : public EventHandler * The value of this is the value of a valid 'type name=' tag. */ std::string oper; - + /** True when DNS lookups are completed. * The UserResolver classes res_forward and res_reverse will * set this value once they complete. @@ -587,7 +587,7 @@ class CoreExport User : public EventHandler * modules may check it. */ std::string password; - + /** User's receive queue. * Lines from the IRCd awaiting processing are stored here. * Upgraded april 2005, old system a bit hairy. @@ -1156,4 +1156,3 @@ class CoreExport UserResolver : public Resolver //class ServerConfig; #endif - diff --git a/include/xline.h b/include/xline.h index 5d0a978b8..6f596ae10 100644 --- a/include/xline.h +++ b/include/xline.h @@ -121,15 +121,15 @@ class CoreExport XLine : public classbase /** The time the line was added. */ time_t set_time; - + /** The duration of the ban, or 0 if permenant */ long duration; - + /** Source of the ban. This can be a servername or an oper nickname */ char* source; - + /** Reason for the ban */ char* reason; @@ -378,7 +378,7 @@ class CoreExport QLine : public XLine */ typedef std::pair IdentHostPair; -/** XLineFactory is used to generate an XLine pointer, given just the +/** XLineFactory is used to generate an XLine pointer, given just the * pattern, timing information and type of line to create. This is used * for example in the spanningtree module which will call an XLineFactory * to create a new XLine when it is inbound on a server link, so that it @@ -399,7 +399,7 @@ class CoreExport XLineFactory : public classbase * @param t Type of XLine this factory generates */ XLineFactory(InspIRCd* Instance, const std::string &t) : ServerInstance(Instance), type(t) { } - + /** Return the type of XLine this factory generates * @return The type of XLine this factory generates */ @@ -547,7 +547,7 @@ class CoreExport XLineManager : public classbase * will generate a new XLine specialized to that type. For example if you * pass the XLineFactory that handles glines some data it will return a * pointer to a GLine, polymorphically represented as XLine. This is used where - * you do not know the full details of the item you wish to create, e.g. in a + * you do not know the full details of the item you wish to create, e.g. in a * server protocol module like m_spanningtree, when you receive xlines from other * servers. * @param xlf XLineFactory pointer to register @@ -681,4 +681,3 @@ class CoreExport ZLineFactory : public XLineFactory }; #endif - diff --git a/make/opensslcert.pm b/make/opensslcert.pm index 1de34eef6..5c6689dc7 100644 --- a/make/opensslcert.pm +++ b/make/opensslcert.pm @@ -44,7 +44,7 @@ __END__ close(FH); my $time = promptstring_s("Please enter the number of days that this certificate is valid for","365"); - + system("cat openssl.template | openssl req -x509 -nodes -newkey rsa:1024 -keyout key.pem -out cert.pem -days $time 2>/dev/null"); system("openssl dhparam -out dhparams.pem 1024"); unlink("openssl.template"); diff --git a/src/channels.cpp b/src/channels.cpp index 9ed0f8ee4..b8195ee9f 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -81,7 +81,7 @@ int Channel::SetTopic(User *u, std::string &ntopic, bool forceset) /* 0: check status, 1: don't, -1: disallow change silently */ FOREACH_RESULT(I_OnLocalTopicChange,OnLocalTopicChange(u,this,ntopic)); - + if (MOD_RESULT == 1) return CMD_FAILURE; else if (MOD_RESULT == 0) diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 9ea7b0202..7c18c8ab1 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -262,10 +262,10 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) command_p.push_back(token); std::transform(command.begin(), command.end(), command.begin(), ::toupper); - + /* find the command, check it exists */ Commandtable::iterator cm = cmdlist.find(command); - + if (cm == cmdlist.end()) { int MOD_RESULT = 0; @@ -310,7 +310,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) { // BE CAREFUL: .end() returns past the end of the vector, hence decrement. std::vector::iterator it = --command_p.end(); - + lparam.insert(0, " " + *(it)); command_p.erase(it); // remove last element } @@ -679,5 +679,3 @@ int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, st return translations; } - - diff --git a/src/commands.cpp b/src/commands.cpp index 18153d87b..9a388684f 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -23,13 +23,13 @@ bool InspIRCd::HostMatchesEveryone(const std::string &mask, User* user) { char itrigger[MAXBUF]; long matches = 0; - + if (!Config->ConfValue(Config->config_data, "insane","trigger", 0, itrigger, MAXBUF)) strlcpy(itrigger,"95.5",MAXBUF); - + if (Config->ConfValueBool(Config->config_data, "insane","hostmasks", 0)) return false; - + for (user_hash::iterator u = this->Users->clientlist->begin(); u != this->Users->clientlist->end(); u++) { if ((InspIRCd::Match(u->second->MakeHost(), mask, ascii_case_insensitive_map)) || @@ -55,13 +55,13 @@ bool InspIRCd::IPMatchesEveryone(const std::string &ip, User* user) { char itrigger[MAXBUF]; long matches = 0; - + if (!Config->ConfValue(Config->config_data, "insane","trigger",0,itrigger,MAXBUF)) strlcpy(itrigger,"95.5",MAXBUF); - + if (Config->ConfValueBool(Config->config_data, "insane","ipmasks",0)) return false; - + for (user_hash::iterator u = this->Users->clientlist->begin(); u != this->Users->clientlist->end(); u++) { if (InspIRCd::Match(u->second->GetIPString(), ip, ascii_case_insensitive_map)) @@ -84,10 +84,10 @@ bool InspIRCd::NickMatchesEveryone(const std::string &nick, User* user) { char itrigger[MAXBUF]; long matches = 0; - + if (!Config->ConfValue(Config->config_data, "insane","trigger",0,itrigger,MAXBUF)) strlcpy(itrigger,"95.5",MAXBUF); - + if (Config->ConfValueBool(Config->config_data, "insane","nickmasks",0)) return false; diff --git a/src/commands/cmd_die.cpp b/src/commands/cmd_die.cpp index 7d9204fe6..9f1bf4591 100644 --- a/src/commands/cmd_die.cpp +++ b/src/commands/cmd_die.cpp @@ -31,7 +31,7 @@ CmdResult CommandDie::Handle (const std::vector& parameters, User * ServerInstance->Logs->Log("COMMAND",SPARSE, diebuf); ServerInstance->SendError(diebuf); } - + if (ServerInstance->Config->DieDelay) sleep(ServerInstance->Config->DieDelay); diff --git a/src/commands/cmd_eline.cpp b/src/commands/cmd_eline.cpp index 782ef8c45..0a4c32866 100644 --- a/src/commands/cmd_eline.cpp +++ b/src/commands/cmd_eline.cpp @@ -25,7 +25,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) CmdResult CommandEline::Handle (const std::vector& parameters, User *user) { std::string target = parameters[0]; - + if (parameters.size() >= 3) { IdentHostPair ih; diff --git a/src/commands/cmd_gline.cpp b/src/commands/cmd_gline.cpp index 18b5fa9ef..ad60b0416 100644 --- a/src/commands/cmd_gline.cpp +++ b/src/commands/cmd_gline.cpp @@ -25,7 +25,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) CmdResult CommandGline::Handle (const std::vector& parameters, User *user) { std::string target = parameters[0]; - + if (parameters.size() >= 3) { IdentHostPair ih; @@ -92,4 +92,3 @@ CmdResult CommandGline::Handle (const std::vector& parameters, User return CMD_SUCCESS; } - diff --git a/src/commands/cmd_kline.cpp b/src/commands/cmd_kline.cpp index 827951366..691c92444 100644 --- a/src/commands/cmd_kline.cpp +++ b/src/commands/cmd_kline.cpp @@ -38,7 +38,7 @@ CmdResult CommandKline::Handle (const std::vector& parameters, User } else ih = ServerInstance->XLines->IdentSplit(target.c_str()); - + if (ih.first.empty()) { user->WriteServ("NOTICE %s :*** Target not found", user->nick.c_str()); @@ -91,4 +91,3 @@ CmdResult CommandKline::Handle (const std::vector& parameters, User return CMD_SUCCESS; } - diff --git a/src/commands/cmd_notice.cpp b/src/commands/cmd_notice.cpp index d22bd2fce..3e249b864 100644 --- a/src/commands/cmd_notice.cpp +++ b/src/commands/cmd_notice.cpp @@ -27,7 +27,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use CUList exempt_list; user->idle_lastmsg = ServerInstance->Time(); - + if (ServerInstance->Parser->LoopCall(user, this, parameters, 0)) return CMD_SUCCESS; if (parameters[0][0] == '$') @@ -123,7 +123,7 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use } return CMD_SUCCESS; } - + const char* destnick = parameters[0].c_str(); if (IS_LOCAL(user)) @@ -185,4 +185,3 @@ CmdResult CommandNotice::Handle (const std::vector& parameters, Use return CMD_SUCCESS; } - diff --git a/src/commands/cmd_oper.cpp b/src/commands/cmd_oper.cpp index da07d631c..270306b05 100644 --- a/src/commands/cmd_oper.cpp +++ b/src/commands/cmd_oper.cpp @@ -128,7 +128,7 @@ CmdResult CommandOper::Handle (const std::vector& parameters, User // tell them they suck, and lag them up to help prevent brute-force attacks user->WriteNumeric(491, "%s :Invalid oper credentials",user->nick.c_str()); user->IncreasePenalty(10); - + snprintf(broadcast, MAXBUF, "WARNING! Failed oper attempt by %s!%s@%s using login '%s': The following fields do not match: %s", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), parameters[0].c_str(), fields.c_str()); ServerInstance->SNO->WriteToSnoMask('o',std::string(broadcast)); ServerInstance->PI->SendSNONotice("o", std::string("OPER: ") + broadcast); @@ -150,4 +150,3 @@ CmdResult CommandOper::Handle (const std::vector& parameters, User } return CMD_SUCCESS; } - diff --git a/src/commands/cmd_part.cpp b/src/commands/cmd_part.cpp index 54fd13216..d9fbfb595 100644 --- a/src/commands/cmd_part.cpp +++ b/src/commands/cmd_part.cpp @@ -44,7 +44,7 @@ CmdResult CommandPart::Handle (const std::vector& parameters, User return CMD_SUCCESS; Channel* c = ServerInstance->FindChan(parameters[0]); - + if (c) { if (!c->PartUser(user, reason)) diff --git a/src/commands/cmd_privmsg.cpp b/src/commands/cmd_privmsg.cpp index 64adafbe8..0ff7661a3 100644 --- a/src/commands/cmd_privmsg.cpp +++ b/src/commands/cmd_privmsg.cpp @@ -26,7 +26,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us CUList except_list; user->idle_lastmsg = ServerInstance->Time(); - + if (ServerInstance->Parser->LoopCall(user, this, parameters, 0)) return CMD_SUCCESS; @@ -120,7 +120,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %c%s :%s", status, chan->name.c_str(), text); } } - else + else { chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %s :%s", chan->name.c_str(), text); } @@ -141,7 +141,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us if (IS_LOCAL(user)) { const char* targetserver = strchr(destnick, '@'); - + if (targetserver) { std::string nickonly; @@ -176,7 +176,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us } int MOD_RESULT = 0; - + std::string temp = parameters[1]; FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user, dest, TYPE_USER, temp, 0, except_list)); if (MOD_RESULT) { @@ -202,4 +202,3 @@ CmdResult CommandPrivmsg::Handle (const std::vector& parameters, Us } return CMD_SUCCESS; } - diff --git a/src/commands/cmd_reloadmodule.cpp b/src/commands/cmd_reloadmodule.cpp index ba31dbd3e..6920896d8 100644 --- a/src/commands/cmd_reloadmodule.cpp +++ b/src/commands/cmd_reloadmodule.cpp @@ -31,7 +31,7 @@ CmdResult CommandReloadmodule::Handle (const std::vector& parameter return CMD_SUCCESS; } } - + ServerInstance->SNO->WriteToSnoMask('A', "RELOAD MODULE: %s unsuccessfully reloaded %s",user->nick.c_str(), parameters[0].c_str()); user->WriteNumeric(975, "%s %s :%s",user->nick.c_str(), parameters[0].c_str(), ServerInstance->Modules->LastError().c_str()); return CMD_FAILURE; diff --git a/src/commands/cmd_stats.cpp b/src/commands/cmd_stats.cpp index aea34511c..66274c58a 100644 --- a/src/commands/cmd_stats.cpp +++ b/src/commands/cmd_stats.cpp @@ -61,7 +61,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str results.push_back(sn + " 481 " + user->nick + " :Permission denied - STATS " + statschar + " requires the servers/auspex priv."); return; } - + int MOD_RESULT = 0; FOREACH_RESULT(I_OnStats,OnStats(statschar, user, results)); if (MOD_RESULT) @@ -93,7 +93,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str case 'n': case 'c': break; - + case 'i': { int idx = 0; @@ -105,7 +105,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str } } break; - + case 'Y': { int idx = 0; @@ -129,7 +129,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str } } break; - + case 'P': { int idx = 0; @@ -145,7 +145,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str results.push_back(sn+" 249 "+user->nick+" :"+ConvToStr(idx)+" OPER(s)"); } break; - + case 'k': ServerInstance->XLines->InvokeStats("K",216,user,results); break; @@ -239,7 +239,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str timeval tv; char percent[30]; gettimeofday(&tv, NULL); - + float n_elapsed = ((tv.tv_sec - ServerInstance->stats->LastSampled.tv_sec) * 1000000 + tv.tv_usec - ServerInstance->stats->LastSampled.tv_usec); float n_eaten = ((R.ru_utime.tv_sec - ServerInstance->stats->LastCPU.tv_sec) * 1000000 + R.ru_utime.tv_usec - ServerInstance->stats->LastCPU.tv_usec); float per = (n_eaten / n_elapsed) * 100; @@ -259,7 +259,7 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, User* user, str #endif } break; - + case 'T': { char buffer[MAXBUF]; diff --git a/src/commands/cmd_userhost.cpp b/src/commands/cmd_userhost.cpp index 8ed5f606c..40ba937c1 100644 --- a/src/commands/cmd_userhost.cpp +++ b/src/commands/cmd_userhost.cpp @@ -23,7 +23,6 @@ CmdResult CommandUserhost::Handle (const std::vector& parameters, U { std::string retbuf = std::string("302 ") + user->nick + " :"; - for (unsigned int i = 0; i < parameters.size(); i++) { User *u = ServerInstance->FindNick(parameters[i]); diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp index 4f44fd518..9ba3c0fc9 100644 --- a/src/commands/cmd_who.cpp +++ b/src/commands/cmd_who.cpp @@ -286,10 +286,10 @@ CmdResult CommandWho::Handle (const std::vector& parameters, User * if (CanView(ch,user)) { bool inside = ch->HasUser(user); - + /* who on a channel. */ CUList *cu = ch->GetUsers(); - + for (CUList::iterator i = cu->begin(); i != cu->end(); i++) { /* None of this applies if we WHO ourselves */ @@ -298,12 +298,12 @@ CmdResult CommandWho::Handle (const std::vector& parameters, User * /* opers only, please */ if (opt_viewopersonly && !IS_OPER(i->first)) continue; - + /* If we're not inside the channel, hide +i users */ if (i->first->IsModeSet('i') && !inside && !user->HasPrivPermission("users/auspex")) continue; } - + SendWhoLine(user, initial, ch, i->first, whoresults); } } @@ -362,4 +362,3 @@ CmdResult CommandWho::Handle (const std::vector& parameters, User * return CMD_FAILURE; } } - diff --git a/src/commands/cmd_whowas.cpp b/src/commands/cmd_whowas.cpp index f15b523c0..6340216f7 100644 --- a/src/commands/cmd_whowas.cpp +++ b/src/commands/cmd_whowas.cpp @@ -56,18 +56,18 @@ CmdResult CommandWhowas::Handle (const std::vector& parameters, Use time_t rawtime = u->signon; tm *timeinfo; char b[MAXBUF]; - + timeinfo = localtime(&rawtime); - + /* XXX - 'b' could be only 25 chars long and then strlcpy() would terminate it for us too? */ strlcpy(b,asctime(timeinfo),MAXBUF); b[24] = 0; user->WriteNumeric(314, "%s %s %s %s * :%s",user->nick.c_str(),parameters[0].c_str(),u->ident,u->dhost,u->gecos); - + if (user->HasPrivPermission("users/auspex")) user->WriteNumeric(379, "%s %s :was connecting from *@%s", user->nick.c_str(), parameters[0].c_str(), u->host); - + if (*ServerInstance->Config->HideWhoisServer && !user->HasPrivPermission("servers/auspex")) user->WriteNumeric(312, "%s %s %s :%s",user->nick.c_str(),parameters[0].c_str(), ServerInstance->Config->HideWhoisServer, b); else diff --git a/src/commands/cmd_zline.cpp b/src/commands/cmd_zline.cpp index f275ac313..b0df24a95 100644 --- a/src/commands/cmd_zline.cpp +++ b/src/commands/cmd_zline.cpp @@ -35,7 +35,7 @@ CmdResult CommandZline::Handle (const std::vector& parameters, User } User *u = ServerInstance->FindNick(target.c_str()); - + if (u) { target = u->GetIPString(); diff --git a/src/dns.cpp b/src/dns.cpp index 0801fc76c..4e2a5b5a9 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -214,7 +214,7 @@ int DNSRequest::SendRequests(const DNSHeader *header, const int length, QueryTyp this->rr_class = 1; this->type = qt; - + DNS::EmptyHeader(payload,header,length); #ifdef IPV6 @@ -250,7 +250,7 @@ DNSRequest* DNS::AddQuery(DNSHeader *header, int &id, const char* original) /* Is the DNS connection down? */ if (this->GetFd() == -1) return NULL; - + /* Create an id */ id = this->PRNG() & DNS::MAX_REQUEST_ID; @@ -405,7 +405,7 @@ DNS::DNS(InspIRCd* Instance) : ServerInstance(Instance) /* DNS::Rehash() sets this to a valid ptr */ this->cache = NULL; - + /* Again, DNS::Rehash() sets this to a * valid value */ @@ -463,7 +463,7 @@ int DNS::GetIP(const char *name) DNSHeader h; int id; int length; - + if ((length = this->MakePayload(name, DNS_QUERY_A, 1, (unsigned char*)&h.payload)) == -1) return -1; @@ -763,7 +763,6 @@ DNSResult DNS::GetResult(int resultnum) default: break; - } /* Build the reply with the id and hostname/ip in it */ @@ -847,7 +846,7 @@ DNSInfo DNSRequest::ResultIsReady(DNSHeader &header, int length, int result_we_w /* XXX: We actually initialise 'rr' here including its ttl field */ if (curanswer == result_we_want) DNS::FillResourceRecord(&rr,&header.payload[i]); - + i += 10; if (rr.type != this->type) { @@ -939,7 +938,7 @@ CachedQuery* DNS::GetCache(const std::string &source) else return NULL; } - + void DNS::DelCache(const std::string &source) { cache->erase(source.c_str()); @@ -1064,7 +1063,7 @@ void DNS::HandleEvent(EventType, int) res = this->GetResult(resultnum); ServerInstance->Logs->Log("RESOLVER",DEBUG,"Result %d id %d", resultnum, res.id); - + /* Is there a usable request id? */ if (res.id != -1) { @@ -1091,7 +1090,7 @@ void DNS::HandleEvent(EventType, int) { if (ServerInstance && ServerInstance->stats) ServerInstance->stats->statsDnsGood++; - + if (!this->GetCache(res.original.c_str())) this->cache->insert(std::make_pair(res.original.c_str(), CachedQuery(res.result, res.ttl))); @@ -1100,14 +1099,14 @@ void DNS::HandleEvent(EventType, int) Classes[res.id] = NULL; } } - + if (ServerInstance && ServerInstance->stats) ServerInstance->stats->statsDns++; } resultnum++; } - + /** Add a derived Resolver to the working set */ bool DNS::AddResolverClass(Resolver* r) { @@ -1169,5 +1168,3 @@ unsigned long DNS::PRNG() val += (s->statsConnects ^ (unsigned long)s->statsSent ^ (unsigned long)s->statsRecv) - ServerInstance->Config->ports.size(); return val; } - - diff --git a/src/dynamic.cpp b/src/dynamic.cpp index fd0b60cf5..29b5c7b94 100644 --- a/src/dynamic.cpp +++ b/src/dynamic.cpp @@ -52,7 +52,7 @@ bool DLLManager::GetSymbol(void** v, const char* sym_name) * try extract a symbol from the library * get any error message is there is any */ - + if (h) { dlerror(); // clear value @@ -61,7 +61,7 @@ bool DLLManager::GetSymbol(void** v, const char* sym_name) if (!*v || err) return false; } - + /* succeeded :) */ return true; } diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index ab4d8368d..8f02e7668 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -290,7 +290,7 @@ std::string irc::hex(const unsigned char *raw, size_t rawsz) return ""; /* EWW! This used to be using sprintf, which is WAY inefficient. -Special */ - + const char *hex = "0123456789abcdef"; static char hexbuf[MAXBUF]; @@ -455,7 +455,7 @@ long irc::portparser::GetToken() { while (((Overlaps(in_range)) && (in_range <= range_end))) in_range++; - + if (in_range <= range_end) return in_range; } @@ -522,4 +522,3 @@ long irc::portparser::GetToken() text = replacement; return text; }*/ - diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index f38b3e6b5..c56dc39ae 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -55,7 +55,7 @@ User* InspIRCd::FindNick(const char* nick) return FindUUID(nick); user_hash::iterator iter = this->Users->clientlist->find(nick); - + if (iter == this->Users->clientlist->end()) return NULL; @@ -204,7 +204,7 @@ bool IsChannelHandler::Call(const char *chname, size_t max) c++; } - size_t len = c - chname; + size_t len = c - chname; /* too long a name - note funky pointer arithmetic here. */ if (len > max) { @@ -219,7 +219,7 @@ bool IsNickHandler::Call(const char* n, size_t max) { if (!n || !*n) return false; - + unsigned int p = 0; for (const char* i = n; *i; i++, p++) { @@ -443,7 +443,7 @@ void InspIRCd::AddExtBanChar(char c) { std::string &tok = Config->data005; std::string::size_type ebpos; - + if ((ebpos = tok.find(" EXTBAN=,")) == std::string::npos) { tok.append(" EXTBAN=,"); @@ -452,6 +452,3 @@ void InspIRCd::AddExtBanChar(char c) else tok.insert(ebpos + 9, 1, c); } - - - diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 431ed13d9..a921db193 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -319,7 +319,7 @@ void InspIRCd::WritePID(const std::string &filename) InspIRCd::InspIRCd(int argc, char** argv) : GlobalCulls(this), - /* Functor initialisation. Note that the ordering here is very important. + /* Functor initialisation. Note that the ordering here is very important. * * THIS MUST MATCH ORDER OF DECLARATION OF THE HandleWhateverFunc classes * within class InspIRCd. @@ -351,7 +351,7 @@ InspIRCd::InspIRCd(int argc, char** argv) #ifdef WIN32 // Strict, frequent checking of memory on debug builds _CrtSetDbgFlag ( _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); - + // Avoid erroneous frees on early exit WindowsIPC = 0; #endif @@ -400,10 +400,10 @@ InspIRCd::InspIRCd(int argc, char** argv) this->PI = new ProtocolInterface(this); this->s_signal = 0; - + // Create base manager classes early, so nothing breaks this->Users = new UserManager(this); - + this->Users->unregistered_count = 0; this->Users->clientlist = new user_hash(); @@ -518,7 +518,7 @@ InspIRCd::InspIRCd(int argc, char** argv) /* Windows can (and defaults to) hide file extensions, so let's play a bit nice for windows users. */ std::string txtconf = this->ConfigFileName; txtconf.append(".txt"); - + if (ServerConfig::FileExists(txtconf.c_str())) { strlcat(this->ConfigFileName, ".txt", MAXBUF); @@ -625,7 +625,7 @@ InspIRCd::InspIRCd(int argc, char** argv) printf("\n"); this->Modules->LoadAll(); - + /* Just in case no modules were loaded - fix for bug #101 */ this->BuildISupport(); InitializeDisabledCommands(Config->DisabledCommands, this); @@ -643,7 +643,7 @@ InspIRCd::InspIRCd(int argc, char** argv) } printf("\nInspIRCd is now running as '%s'[%s] with %d max open sockets\n", Config->ServerName,Config->GetSID().c_str(), SE->GetMaxFds()); - + #ifndef WINDOWS if (!Config->nofork) { @@ -852,7 +852,7 @@ int InspIRCd::Run() this->stats->LastCPU = ru.ru_utime; } #else - WindowsIPC->Check(); + WindowsIPC->Check(); #endif } diff --git a/src/inspstring.cpp b/src/inspstring.cpp index 5955ae845..b4c581f94 100644 --- a/src/inspstring.cpp +++ b/src/inspstring.cpp @@ -24,9 +24,9 @@ * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * @@ -41,7 +41,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + #ifndef HAS_STRLCPY CoreExport size_t strlcat(char *dst, const char *src, size_t siz) { @@ -136,4 +136,3 @@ CoreExport bool charremove(char* mp, char remove) return shift_down; } - diff --git a/src/logger.cpp b/src/logger.cpp index d40e366b4..d8c1a3b0b 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -31,7 +31,7 @@ * * How it works: * Modules create their own logstream types (core will create one for 'file logging' for example) and create instances of these logstream types - * and register interest in a certain logtype. Globbing is not here, with the exception of * - for all events.. loglevel is used to drop + * and register interest in a certain logtype. Globbing is not here, with the exception of * - for all events.. loglevel is used to drop * events that are of no interest to a logstream. * * When Log is called, the vector of logstreams for that type is iterated (along with the special vector for "*"), and all registered logstreams @@ -41,7 +41,7 @@ * NOTE: Somehow we have to let LogManager manage the non-blocking file streams and provide an interface to share them with various LogStreams, * as, for example, a user may want to let 'KILL' and 'XLINE' snotices go to /home/ircd/inspircd/logs/operactions.log, or whatever. How * can we accomplish this easily? I guess with a map of pre-loved logpaths, and a pointer of FILE *.. - * + * */ void LogManager::SetupNoFork() @@ -363,4 +363,3 @@ void FileWriter::Close() FileWriter::~FileWriter() { } - diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp index db1926044..3540346b5 100644 --- a/src/modes/cmode_k.cpp +++ b/src/modes/cmode_k.cpp @@ -22,7 +22,7 @@ ModeChannelKey::ModeChannelKey(InspIRCd* Instance) : ModeHandler(Instance, 'k', } ModePair ModeChannelKey::ModeSet(User*, User*, Channel* channel, const std::string ¶meter) -{ +{ if (channel->modes[CM_KEY]) { std::string ckey = channel->GetModeParameter('k'); @@ -101,4 +101,3 @@ ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, s return MODEACTION_DENY; } } - diff --git a/src/modules.cpp b/src/modules.cpp index b9f5de63c..0f7992a38 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -400,21 +400,21 @@ bool ModuleManager::Load(const char* filename) Instance->Logs->Log("MODULE", DEFAULT, LastModuleError); return false; } - + if (!ServerConfig::FileExists(modfile)) { LastModuleError = "Module file could not be found: " + filename_str; Instance->Logs->Log("MODULE", DEFAULT, LastModuleError); return false; } - + if (Modules.find(filename_str) != Modules.end()) - { + { LastModuleError = "Module " + filename_str + " is already loaded, cannot load a module twice!"; Instance->Logs->Log("MODULE", DEFAULT, LastModuleError); return false; } - + Module* newmod = NULL; ircd_module* newhandle = NULL; @@ -569,8 +569,8 @@ void ModuleManager::LoadAll() { Instance->Config->ConfValue(Instance->Config->config_data, "module", "name", count, configToken, MAXBUF); printf_c("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",configToken); - - if (!this->Load(configToken)) + + if (!this->Load(configToken)) { Instance->Logs->Log("MODULE", DEFAULT, this->LastError()); printf_c("\n[\033[1;31m*\033[0m] %s\n\n", this->LastError().c_str()); @@ -592,7 +592,7 @@ bool ModuleManager::PublishFeature(const std::string &FeatureName, Module* Mod) bool ModuleManager::UnpublishFeature(const std::string &FeatureName) { featurelist::iterator iter = Features.find(FeatureName); - + if (iter == Features.end()) return false; @@ -843,9 +843,9 @@ ConfigReader::ConfigReader(InspIRCd* Instance, const std::string &filename) : Se std::string ConfigReader::ReadValue(const std::string &tag, const std::string &name, const std::string &default_value, int index, bool allow_linefeeds) { - /* Don't need to strlcpy() tag and name anymore, ReadConf() takes const char* */ + /* Don't need to strlcpy() tag and name anymore, ReadConf() takes const char* */ std::string result; - + if (!ServerInstance->Config->ConfValue(*this->data, tag, name, default_value, index, result, allow_linefeeds)) { this->error = CONF_VALUE_NOT_FOUND; @@ -872,19 +872,19 @@ bool ConfigReader::ReadFlag(const std::string &tag, const std::string &name, int int ConfigReader::ReadInteger(const std::string &tag, const std::string &name, const std::string &default_value, int index, bool need_positive) { int result; - + if(!ServerInstance->Config->ConfValueInteger(*this->data, tag, name, default_value, index, result)) { this->error = CONF_VALUE_NOT_FOUND; return 0; } - + if ((need_positive) && (result < 0)) { this->error = CONF_INT_NEGATIVE; return 0; } - + return result; } diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index c7c2e0c0d..b16ebd12b 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -73,7 +73,6 @@ public: ServerInstance->Modules->Attach(eventlist, this, 3); } - bool OneOfMatches(const char* host, const char* ip, const char* hostlist) { std::stringstream hl(hostlist); diff --git a/src/modules/extra/m_sqlutils.h b/src/modules/extra/m_sqlutils.h index dab9c721a..6fb741531 100644 --- a/src/modules/extra/m_sqlutils.h +++ b/src/modules/extra/m_sqlutils.h @@ -34,12 +34,12 @@ public: /** User */ User* user; - + AssociateUser(Module* s, Module* d, unsigned long i, User* u) : Request(s, d, SQLUTILAU), id(i), user(u) { } - + AssociateUser& S() { Send(); @@ -58,12 +58,12 @@ public: /** Channel */ Channel* chan; - + AssociateChan(Module* s, Module* d, unsigned long i, Channel* u) : Request(s, d, SQLUTILAC), id(i), chan(u) { } - + AssociateChan& S() { Send(); @@ -84,7 +84,7 @@ public: : Request(s, d, SQLUTILUA), id(i) { } - + UnAssociate& S() { Send(); @@ -108,7 +108,7 @@ public: : Request(s, d, SQLUTILGU), id(i), user(NULL) { } - + GetAssocUser& S() { Send(); @@ -132,7 +132,7 @@ public: : Request(s, d, SQLUTILGC), id(i), chan(NULL) { } - + GetAssocChan& S() { Send(); diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 1a8da4da3..4d3c8fd86 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -240,7 +240,7 @@ class ModuleSSLGnuTLS : public Module keyfile = confdir + keyfile; int ret; - + if (cred_alloc) { // Deallocate the old credentials @@ -249,13 +249,13 @@ class ModuleSSLGnuTLS : public Module } else cred_alloc = true; - + if((ret = gnutls_certificate_allocate_credentials(&x509_cred)) < 0) ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to allocate certificate credentials: %s", gnutls_strerror(ret)); - + if((ret = gnutls_dh_params_init(&dh_params)) < 0) ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to initialise DH parameters: %s", gnutls_strerror(ret)); - + if((ret =gnutls_certificate_set_x509_trust_file(x509_cred, cafile.c_str(), GNUTLS_X509_FMT_PEM)) < 0) ServerInstance->Logs->Log("m_ssl_gnutls",DEFAULT, "m_ssl_gnutls.so: Failed to set X.509 trust file '%s': %s", cafile.c_str(), gnutls_strerror(ret)); diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 1d601127a..39d19b2bc 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -68,7 +68,7 @@ class ModuleAlias : public Module ConfigReader MyConf(ServerInstance); AllowBots = MyConf.ReadFlag("fantasy", "allowbots", "no", 0); - + std::string fpre = MyConf.ReadValue("fantasy","prefix",0); fprefix = fpre.empty() ? '!' : fpre[0]; @@ -231,7 +231,7 @@ class ModuleAlias : public Module if (i == Aliases.end()) return 0; - + /* Avoid iterating on to other aliases if no patterns match */ std::multimap::iterator upperbound = Aliases.upper_bound(fcommand); @@ -255,7 +255,7 @@ class ModuleAlias : public Module i++; } - + return 0; } @@ -361,7 +361,7 @@ class ModuleAlias : public Module if (c) { /* Channel specific variables */ - SearchAndReplace(newline, std::string("$chan"), c->name); + SearchAndReplace(newline, std::string("$chan"), c->name); } irc::tokenstream ss(newline); diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 892c18bd1..85c8660a2 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -194,7 +194,7 @@ class ChanFounder : public ModeHandler, public FounderProtectBase { return FounderProtectBase::HandleChange(source, theuser, adding, channel, parameter); } - + char isoverride=0; Module *Override = ServerInstance->Modules->FindFeature("Override"); if (Override) diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index beb2b32e5..0382ea836 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -135,7 +135,7 @@ class CommandDccallow : public Command user->WriteNumeric(996, "%s %s :You cannot add yourself to your own DCCALLOW list!", user->nick.c_str(), user->nick.c_str()); return CMD_FAILURE; } - + if (!user->GetExt("dccallow_list", dl)) { dl = new dccallowlist; @@ -143,7 +143,7 @@ class CommandDccallow : public Command // add this user to the userlist ul.push_back(user); } - + for (dccallowlist::const_iterator k = dl->begin(); k != dl->end(); ++k) { if (k->nickname == target->nick) @@ -356,7 +356,7 @@ class ModuleDCCAllow : public Module return 0; } } - + user->WriteServ("NOTICE %s :The user %s is not accepting DCC SENDs from you. Your file %s was not sent.", user->nick.c_str(), u->nick.c_str(), filename.c_str()); u->WriteServ("NOTICE %s :%s (%s@%s) attempted to send you a file named %s, which was blocked.", u->nick.c_str(), user->nick.c_str(), user->ident.c_str(), user->dhost.c_str(), filename.c_str()); u->WriteServ("NOTICE %s :If you trust %s and were expecting this, you can type /DCCALLOW HELP for information on the DCCALLOW system.", u->nick.c_str(), user->nick.c_str()); @@ -476,4 +476,3 @@ class ModuleDCCAllow : public Module }; MODULE_INIT(ModuleDCCAllow) - diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 71742d596..60ae7e891 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -281,7 +281,7 @@ int FilterBase::OnUserPreNotice(User* user,void* dest,int target_type, std::stri if (i != exemptfromfilter.end()) return 0; } if (f->action == "block") - { + { ServerInstance->SNO->WriteToSnoMask('A', std::string("FILTER: ")+user->nick+" had their message filtered, target was "+target+": "+f->reason); user->WriteServ("NOTICE "+std::string(user->nick)+" :Your message has been filtered and opers notified: "+f->reason); } @@ -318,7 +318,7 @@ int FilterBase::OnPreCommand(std::string &command, std::vector &par std::string checkline; int replacepoint = 0; bool parting = false; - + if (command == "QUIT") { /* QUIT with no reason: nothing to do */ @@ -348,7 +348,7 @@ int FilterBase::OnPreCommand(std::string &command, std::vector &par return 0; FilterResult* f = NULL; - + if (flags) f = this->FilterMatch(user, checkline, flags); @@ -683,4 +683,3 @@ class ModuleFilter : public FilterBase }; MODULE_INIT(ModuleFilter) - diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp index bb0b3ac63..27c749b3d 100644 --- a/src/modules/m_operprefix.cpp +++ b/src/modules/m_operprefix.cpp @@ -14,7 +14,7 @@ /* * Originally by Chernov-Phoenix Alexey (Phoenix@RusNet) mailto:phoenix /email address separator/ pravmail.ru */ - + /* $ModDesc: Gives opers cmode +y which provides a staff prefix. */ #include "inspircd.h" @@ -118,7 +118,7 @@ class ModuleOperPrefixMode : public Module opm = new OperPrefixMode(ServerInstance); if ((!ServerInstance->Modes->AddMode(opm))) throw ModuleException("Could not add a new mode!"); - + Implementation eventlist[] = { I_OnPostJoin, I_OnCleanup, I_OnUserQuit, I_OnUserKick, I_OnUserPart, I_OnOper }; ServerInstance->Modules->Attach(eventlist, this, 6); } @@ -239,4 +239,3 @@ class ModuleOperPrefixMode : public Module }; MODULE_INIT(ModuleOperPrefixMode) - diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index cf2723bec..3010e1e46 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -131,7 +131,7 @@ class ModuleOverride : public Module { // If the kicker's status is less than the target's, or the kicker's status is less than or equal to voice if ((chan->GetStatus(source) < chan->GetStatus(user)) || (chan->GetStatus(source) <= STATUS_VOICE)) - { + { ServerInstance->SNO->WriteToSnoMask('G',std::string(source->nick)+" used oper override to kick "+std::string(user->nick)+" on "+std::string(chan->name)+" ("+reason+")"); } /* Returning -1 explicitly allows the kick */ diff --git a/src/modules/m_regex.h b/src/modules/m_regex.h index 85f52c4d8..3880be342 100644 --- a/src/modules/m_regex.h +++ b/src/modules/m_regex.h @@ -45,7 +45,7 @@ class RegexFactoryRequest : public Request { private: std::string regex; - + public: Regex* result; diff --git a/src/modules/m_satopic.cpp b/src/modules/m_satopic.cpp index 6c976d6ba..d71807c69 100644 --- a/src/modules/m_satopic.cpp +++ b/src/modules/m_satopic.cpp @@ -37,7 +37,7 @@ class CommandSATopic : public Command if(target) { std::string newTopic = parameters[1]; - + // 3rd parameter overrides access checks target->SetTopic(user, newTopic, true); ServerInstance->SNO->WriteToSnoMask('A', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic); diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index ebe1b1220..6789d26d8 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -229,7 +229,7 @@ class ModuleServicesAccount : public Module // user is ulined, won't be stopped from joining return 0; } - + if (chan->IsModeSet('R')) { if (!is_registered) diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index 12484e195..7f0500fe5 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -24,7 +24,7 @@ class ServProtectMode : public ModeHandler ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool) { - /* Because this returns MODEACTION_DENY all the time, there is only ONE + /* Because this returns MODEACTION_DENY all the time, there is only ONE * way to add this mode and that is at client introduction in the UID command, * as this calls OnModeChange for each mode but disregards the return values. * The mode cannot be manually added or removed, not even by a server or by a remote diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index f4939c00e..49d345383 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -369,5 +369,3 @@ TreeServer::~TreeServer() if (iter != Utils->sidlist.end()) Utils->sidlist.erase(iter); } - - diff --git a/src/modules/m_spanningtree/treeserver.h b/src/modules/m_spanningtree/treeserver.h index 528414261..fea17b7d2 100644 --- a/src/modules/m_spanningtree/treeserver.h +++ b/src/modules/m_spanningtree/treeserver.h @@ -56,7 +56,7 @@ class TreeServer : public classbase bool Warned; /* True if we've warned opers about high latency on this server */ bool bursting; /* whether or not this server is bursting */ - + /** We don't use this constructor. Its a dummy, and won't cause any insertion * of the TreeServer into the hash_map. See below for the two we DO use. */ @@ -67,7 +67,7 @@ class TreeServer : public classbase * no socket associated with it. Its version string is our own local version. */ TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc, const std::string &id); - + /** When we create a new server, we call this constructor to initialize it. * This constructor initializes the server's Route and Parent, and sets up * its ping counters so that it will be pinged one minute from now. @@ -121,7 +121,7 @@ class TreeServer : public classbase /** Round trip time of last ping */ unsigned long rtt; - + /** When we recieved BURST from this server, used to calculate total burst time at ENDBURST. */ unsigned long StartBurst; diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 4d87c450c..c006344ba 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -250,7 +250,7 @@ bool TreeSocket::ProcessLine(std::string &line) * "miscreant" servers, though, so let's check anyway. -- w * * We also check here for totally invalid prefixes (prefixes that are neither - * a valid SID or a valid UUID, so that invalid UUID or SID never makes it + * a valid SID or a valid UUID, so that invalid UUID or SID never makes it * to the higher level functions. -- B */ std::string direction = prefix; @@ -694,5 +694,3 @@ void TreeSocket::OnClose() this->ServerInstance->SNO->WriteToSnoMask('l', "Connection to '\2%s\2' was established for %s", quitserver.c_str(), Utils->Creator->TimeToStr(server_uptime).c_str()); } } - - diff --git a/src/modules/rpc.h b/src/modules/rpc.h index 75a7efd62..36f1c031a 100644 --- a/src/modules/rpc.h +++ b/src/modules/rpc.h @@ -25,27 +25,27 @@ class RPCValue : public classbase protected: RPCValueType type; void *value; - + double *CastInteger() { return (double*)value; } - + std::string *CastString() { return (std::string*)value; } - + RPCObjectContainer *CastObject() { return (RPCObjectContainer*)value; } - + RPCArrayContainer *CastArray() { return (RPCArrayContainer*)value; } - + void DestroyValue() { // Some versions of GCC complain about declaration in switch statements @@ -74,10 +74,10 @@ class RPCValue : public classbase default: break; } - + value = NULL; } - + void InitValue() { switch (type) @@ -100,9 +100,9 @@ class RPCValue : public classbase break; } } - + RPCValue(const RPCValue &v) { } - + public: RPCValue *parent; @@ -111,30 +111,30 @@ class RPCValue : public classbase RPCValue(bool nvalue, RPCValue *rparent = NULL) : type(RPCBoolean), value((void*)nvalue), parent(rparent) { } RPCValue(double nvalue, RPCValue *rparent = NULL) : type(RPCInteger), parent(rparent) { value = new double(nvalue); } RPCValue(const std::string &nvalue, RPCValue *rparent = NULL) : type(RPCString), parent(rparent) { value = new std::string(nvalue); } - + virtual ~RPCValue() { DestroyValue(); } - + RPCValueType GetType() { return type; } - + void SetNull() { DestroyValue(); type = RPCNull; } - + void SetBoolean(bool nvalue) { DestroyValue(); value = (void*)nvalue; type = RPCBoolean; } - + void SetInteger(double nvalue) { if (type == RPCInteger) @@ -148,7 +148,7 @@ class RPCValue : public classbase type = RPCInteger; } } - + void SetString(const std::string &nvalue) { if (type == RPCString) @@ -162,7 +162,7 @@ class RPCValue : public classbase type = RPCString; } } - + void SetArray() { if (type == RPCArray) @@ -176,7 +176,7 @@ class RPCValue : public classbase InitValue(); } } - + void SetObject() { if (type == RPCObject) @@ -190,7 +190,7 @@ class RPCValue : public classbase InitValue(); } } - + void ArrayAdd(RPCValue *nvalue) { if (type != RPCArray) @@ -199,7 +199,7 @@ class RPCValue : public classbase a->push_back(nvalue); nvalue->parent = this; } - + void ObjectAdd(const std::string &key, RPCValue *nvalue) { if (type != RPCObject) @@ -208,7 +208,7 @@ class RPCValue : public classbase o->insert(std::make_pair(key, nvalue)); nvalue->parent = this; } - + RPCValue *GetArray(int i) { if (type != RPCArray) @@ -218,7 +218,7 @@ class RPCValue : public classbase return NULL; return a->at(i); } - + int ArraySize() { if (type != RPCArray) @@ -226,7 +226,7 @@ class RPCValue : public classbase RPCArrayContainer *a = this->CastArray(); return a->size(); } - + RPCValue *GetObject(const std::string &key) { if (type != RPCObject) @@ -237,7 +237,7 @@ class RPCValue : public classbase return NULL; return it->second; } - + std::pair GetObjectIterator() { if (type != RPCObject) @@ -245,21 +245,21 @@ class RPCValue : public classbase RPCObjectContainer *o = this->CastObject(); return std::make_pair(o->begin(), o->end()); } - + std::string GetString() { if (type != RPCString) return std::string(); return *this->CastString(); } - + double GetInt() { if (type != RPCInteger) return 0; return *this->CastInteger(); } - + bool GetBool() { if (type != RPCBoolean) @@ -271,7 +271,7 @@ class RPCValue : public classbase class RPCRequest : public classbase { protected: - + public: std::string method; RPCValue *parameters; @@ -279,13 +279,13 @@ class RPCRequest : public classbase std::string provider; bool claimed; std::string error; - + RPCRequest(const std::string &sprovider, const std::string &smethod, RPCValue *rparameters) : method(smethod), parameters(rparameters), provider(sprovider), claimed(false) { result = new RPCValue(); } - + ~RPCRequest() { if (result) diff --git a/src/modules/transport.h b/src/modules/transport.h index 269880b75..1ca3e9470 100644 --- a/src/modules/transport.h +++ b/src/modules/transport.h @@ -50,7 +50,7 @@ class ssl_cert : public Extensible ssl_cert() : empty("") { } - + /** Get certificate distinguished name * @return Certificate DN */ @@ -228,4 +228,3 @@ class BufferedSocketNameRequest : public ISHRequest }; #endif - diff --git a/src/server.cpp b/src/server.cpp index 75e404b80..734e551b0 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -148,7 +148,7 @@ void InspIRCd::IncrementUID(int pos) for (int i = 3; i < UUID_LENGTH; i++) { current_uid[i] = 'A'; - pos = UUID_LENGTH - 1; + pos = UUID_LENGTH - 1; } } else diff --git a/src/snomasks.cpp b/src/snomasks.cpp index cde8839ca..c166bd72d 100644 --- a/src/snomasks.cpp +++ b/src/snomasks.cpp @@ -24,7 +24,7 @@ SnomaskManager::SnomaskManager(InspIRCd* Instance) : ServerInstance(Instance) } SnomaskManager::~SnomaskManager() -{ +{ for (std::map::iterator i = SnoMasks.begin(); i != SnoMasks.end(); i++) { delete i->second; diff --git a/src/socket.cpp b/src/socket.cpp index fa5f0709c..649f3ee5f 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -20,7 +20,7 @@ /** This will bind a socket to a port. It works for UDP/TCP. * It can only bind to IP addresses, if you wish to bind to hostnames * you should first resolve them using class 'Resolver'. - */ + */ bool InspIRCd::BindSocket(int sockfd, int port, const char* addr, bool dolisten) { /* We allocate 2 of these, because sockaddr_in6 is larger than sockaddr (ugh, hax) */ @@ -195,10 +195,10 @@ int InspIRCd::BindPorts(bool, int &ports_found, FailedPortList &failed_ports) Config->ConfValue(Config->config_data, "bind", "port", count, configToken, MAXBUF); Config->ConfValue(Config->config_data, "bind", "address", count, Addr, MAXBUF); Config->ConfValue(Config->config_data, "bind", "type", count, Type, MAXBUF); - + if (strncmp(Addr, "::ffff:", 7) == 0) this->Logs->Log("SOCKET",DEFAULT, "Using 4in6 (::ffff:) isn't recommended. You should bind IPv4 addresses directly instead."); - + if ((!*Type) || (!strcmp(Type,"clients"))) { irc::portparser portrange(configToken, false); diff --git a/src/socketengine.cpp b/src/socketengine.cpp index 43de35e1e..e9554bee3 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -149,7 +149,7 @@ std::string SocketEngine::GetName() } bool SocketEngine::BoundsCheckFd(EventHandler* eh) -{ +{ if (!eh) return false; if ((eh->GetFd() < 0) || (eh->GetFd() > MAX_DESCRIPTORS)) diff --git a/src/socketengines/socketengine_iocp.cpp b/src/socketengines/socketengine_iocp.cpp index 7dce02dbd..6425d5fca 100644 --- a/src/socketengines/socketengine_iocp.cpp +++ b/src/socketengines/socketengine_iocp.cpp @@ -166,7 +166,7 @@ bool IOCPEngine::DelFd(EventHandler* eh, bool force /* = false */) /* decrement set size */ --CurrentSetSize; - + /* success */ return true; } @@ -175,7 +175,7 @@ void IOCPEngine::WantWrite(EventHandler* eh) { if (!eh) return; - + void* m_writeEvent = NULL; int* fake_fd = NULL; @@ -351,7 +351,7 @@ int IOCPEngine::DispatchEvents() } } break; - + case SOCKET_IO_EVENT_ACCEPT: { /* this is kinda messy.. :/ */ @@ -370,7 +370,7 @@ int IOCPEngine::DispatchEvents() } break; } - + delete ov; } @@ -464,7 +464,7 @@ int IOCPEngine::Accept(EventHandler* fd, sockaddr *addr, socklen_t *addrlen) Overlapped* ovl = acceptevent; accept_overlap* ov = (accept_overlap*)ovl->m_params; - + //sockaddr_in* server_address = (sockaddr_in*)&ov->buf[10]; sockaddr_in* client_address = (sockaddr_in*)&ov->buf[38]; @@ -477,7 +477,7 @@ int IOCPEngine::Accept(EventHandler* fd, sockaddr *addr, socklen_t *addrlen) int IOCPEngine::GetSockName(EventHandler* fd, sockaddr *name, socklen_t* namelen) { Overlapped* ovl = NULL; - + if (!fd->GetExt("windows_acceptevent", ovl)) return -1; @@ -524,5 +524,3 @@ int IOCPEngine::Close(EventHandler* fd) { return this->Close(fd->GetFd()); } - - diff --git a/src/socketengines/socketengine_kqueue.cpp b/src/socketengines/socketengine_kqueue.cpp index 80d73581e..76ef3851e 100644 --- a/src/socketengines/socketengine_kqueue.cpp +++ b/src/socketengines/socketengine_kqueue.cpp @@ -33,7 +33,7 @@ void KQueueEngine::RecoverFromFork() /* * The only bad thing about kqueue is that its fd cant survive a fork and is not inherited. * BUM HATS. - * + * */ EngineHandle = kqueue(); if (EngineHandle == -1) diff --git a/src/timer.cpp b/src/timer.cpp index 27f2aecfd..ec0ddb645 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -26,7 +26,7 @@ void TimerManager::TickTimers(time_t TIME) { std::vector::iterator i = Timers.begin(); Timer *t = (*i); - + // Probable fix: move vector manipulation to *before* we modify the vector. Timers.erase(i); @@ -62,5 +62,3 @@ bool TimerManager::TimerComparison( Timer *one, Timer *two) { return (one->GetTimer()) < (two->GetTimer()); } - - diff --git a/src/user_resolver.cpp b/src/user_resolver.cpp index 820d7ef65..bd27d6350 100644 --- a/src/user_resolver.cpp +++ b/src/user_resolver.cpp @@ -102,7 +102,7 @@ void UserResolver::OnLookupComplete(const std::string &result, unsigned int ttl, this->bound_user->dns_done = true; } } - + // Save some memory by freeing this up; it's never used again in the user's lifetime. this->bound_user->stored_host.resize(0); } diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 86b324c82..f8b1f0de2 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -275,7 +275,7 @@ void UserManager::RemoveCloneCounts(User *user) local_clones.erase(x); } } - + clonemap::iterator y = global_clones.find(user->GetCIDRMask(range)); if (y != global_clones.end()) { @@ -487,6 +487,3 @@ int UserManager::ModeCount(const char mode) else return 0; } - - - diff --git a/src/users.cpp b/src/users.cpp index fd71b07ad..7ce7ea673 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -483,7 +483,7 @@ bool User::HasModePermission(unsigned char mode, ModeType type) if (mode < 'A' || mode > ('A' + 64)) return false; return ((type == MODETYPE_USER ? AllowedUserModes : AllowedChanModes))[(mode - 'A')]; - + } bool User::HasPermission(const std::string &command) @@ -918,7 +918,7 @@ void User::CheckClass() bool User::CheckLines(bool doZline) { const char* check[] = { "G" , "K", (doZline) ? "Z" : NULL, NULL }; - + if (!this->exempt) { for (int n = 0; check[n]; ++n) @@ -948,7 +948,7 @@ void User::FullConnect() * Don't remove this! -- w00t */ this->SetClass(); - + /* Check the password, if one is required by the user's connect class. * This CANNOT be in CheckClass(), because that is called prior to PASS as well! */ @@ -1158,7 +1158,7 @@ const char* User::GetCIDRMask(int range) sockaddr_in6* sin; int i, bytestozero, extrabits; char buffer[40]; - + if(range > 128) throw "CIDR mask width greater than address width (IPv6, 128 bit)"; @@ -1171,12 +1171,12 @@ const char* User::GetCIDRMask(int range) * which must be set to zero. */ bytestozero = (128 - range) / 8; - + /* Some of the least significant bits of the next most significant byte may also have to * be zeroed. The number of bits is the remainder of the above division. */ extrabits = (128 - range) % 8; - + /* Populate our working struct with the parts of the user's IP which are required in the * final CIDR mask. Set all the subsequent bytes to zero. * (16 - bytestozero) is the number of bytes which must be populated with actual IP data. @@ -1185,13 +1185,13 @@ const char* User::GetCIDRMask(int range) { v6.s6_addr[i] = sin->sin6_addr.s6_addr[i]; } - + /* And zero all the remaining bytes in the IP. */ for(; i < 16; i++) { v6.s6_addr[i] = 0; } - + /* And finally, zero the extra bits required. */ v6.s6_addr[15 - bytestozero] = (v6.s6_addr[15 - bytestozero] >> extrabits) << extrabits; @@ -1268,7 +1268,7 @@ const char* User::GetIPString() this->cachedip = temp; return temp; } - + this->cachedip = buf; return buf; } @@ -1285,7 +1285,7 @@ const char* User::GetIPString() default: break; } - + // Unreachable, probably return ""; } @@ -1866,7 +1866,7 @@ ConnectClass* User::SetClass(const std::string &explicit_name) } /* check if host matches.. */ - if (!InspIRCd::MatchCIDR(this->GetIPString(), c->GetHost(), NULL) && + if (!InspIRCd::MatchCIDR(this->GetIPString(), c->GetHost(), NULL) && !InspIRCd::MatchCIDR(this->host, c->GetHost(), NULL)) { ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "No host match (for %s)", c->GetHost().c_str()); @@ -2054,4 +2054,3 @@ bool VisData::VisibleTo(User* user) { return true; } - diff --git a/src/xline.cpp b/src/xline.cpp index da46c2eee..c92643bcd 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -18,7 +18,7 @@ #include "bancache.h" /* - * This is now version 3 of the XLine subsystem, let's see if we can get it as nice and + * This is now version 3 of the XLine subsystem, let's see if we can get it as nice and * efficient as we can this time so we can close this file and never ever touch it again .. * * Background: @@ -192,7 +192,7 @@ bool XLineManager::AddLine(XLine* line, User* user) lookup_lines[line->type][line->Displayable()] = line; line->OnAdd(); - FOREACH_MOD(I_OnAddLine,OnAddLine(user, line)); + FOREACH_MOD(I_OnAddLine,OnAddLine(user, line)); return true; } @@ -423,7 +423,7 @@ XLineManager::~XLineManager() i->second.clear(); } lookup_lines.clear(); - + } void XLine::Apply(User* u) @@ -498,7 +498,7 @@ bool GLine::Matches(User *u) } void GLine::Apply(User* u) -{ +{ DefaultApply(u, "G", (strcmp(this->identmask, "*") == 0) ? true : false); } @@ -531,7 +531,7 @@ bool ZLine::Matches(User *u) } void ZLine::Apply(User* u) -{ +{ DefaultApply(u, "Z", true); } @@ -545,7 +545,7 @@ bool QLine::Matches(User *u) } void QLine::Apply(User* u) -{ +{ /* Force to uuid on apply of qline, no need to disconnect any more :) */ u->ForceNickChange(u->uuid.c_str()); } @@ -681,4 +681,3 @@ XLineFactory* XLineManager::GetFactory(const std::string &type) return n->second; } - -- cgit v1.2.3