]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cloaking.cpp
Fix all typos (not as fun as 'kill all humans' but meh, beggers cant be choosers)
[user/henk/code/inspircd.git] / src / modules / m_cloaking.cpp
index 92ae1af6c5e8c79ad7da675a94f6db250a61ce74..21e275c1eaa230df2b7063372f14d1f38bbc8541 100644 (file)
@@ -33,6 +33,7 @@ using namespace std;
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#include <stdint.h>
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
@@ -48,7 +49,7 @@ using namespace std;
 #define F4(x, y, z) (y ^ (x | ~z))
 #define MD5STEP(f,w,x,y,z,in,s) (w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x)
 
-typedef unsigned long word32;
+typedef uint32_t word32; /* NOT unsigned long. We don't support 16 bit platforms, anyway. */
 typedef unsigned char byte;
 
 struct xMD5Context {
@@ -63,10 +64,10 @@ class ModuleCloaking : public Module
 
        Server *Srv;
        std::string prefix;
-       int key1;
-       int key2;
-       int key3;
-       int key4;
+       word32 key1;
+       word32 key2;
+       word32 key3;
+       word32 key4;
 
        void byteSwap(word32 *buf, unsigned words)
        {
@@ -368,22 +369,22 @@ class ModuleCloaking : public Module
                                        this->GenHash(dest->host,ra);
                                        std::string b = "";
                                        in_addr testaddr;
-                                        std::string hostcloak = prefix + "-" + std::string(ra) + a;
-                                        /* Fix by brain - if the cloaked host is > the max length of a host (64 bytes
-                                         * according to the DNS RFC) then tough titty, they get cloaked as an IP. 
-                                         * Their ISP shouldnt go to town on subdomains, or they shouldnt have a kiddie
-                                         * vhost.
-                                         */
-                                        if ((!inet_aton(dest->host,&testaddr)) && (hostcloak.length() < 64))
-                                        {
-                                                // if they have a hostname, make something appropriate
-                                                b = hostcloak;
-                                        }
-                                        else
-                                        {
-                                                // else, they have an ip
-                                                b = std::string(ra) + "." + prefix + ".cloak";
-                                        }
+                                       std::string hostcloak = prefix + "-" + std::string(ra) + a;
+                                       /* Fix by brain - if the cloaked host is > the max length of a host (64 bytes
+                                        * according to the DNS RFC) then tough titty, they get cloaked as an IP. 
+                                        * Their ISP shouldnt go to town on subdomains, or they shouldnt have a kiddie
+                                        * vhost.
+                                        */
+                                       if ((!inet_aton(dest->host,&testaddr)) && (hostcloak.length() < 64))
+                                       {
+                                               // if they have a hostname, make something appropriate
+                                               b = hostcloak;
+                                       }
+                                       else
+                                       {
+                                               // else, they have an ip
+                                               b = std::string(ra) + "." + prefix + ".cloak";
+                                       }
                                        Srv->Log(DEBUG,"cloak: allocated "+b);
                                        Srv->ChangeHost(dest,b);
                                }