]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_http_client.cpp
This needs some general QA-ing. Add support to new parser (introduced in 1.1) for...
[user/henk/code/inspircd.git] / src / modules / m_http_client.cpp
index 7060081044affbbd5f1ba82bc38b40b440ab8c39..5ddd6ddbd92a849f770e92fde85dff01c21a63c2 100644 (file)
@@ -1,4 +1,4 @@
-/*       +------------------------------------+
+;/*       +------------------------------------+
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
@@ -156,7 +156,13 @@ bool HTTPSocket::DoRequest(HTTPClientRequest *req)
        this->port = url.port;
        strlcpy(this->host, url.domain.c_str(), MAXBUF);
 
-       if (insp_aton(this->host, &this->addy) < 1)
+       in_addr addy1;
+#ifdef IPV6
+       in6_addr addy2;
+       if ((inet_aton(this->host, &addy1) > 0) || (inet_pton(AF_INET6, this->host, &addy2) > 0))
+#else
+       if (inet_aton(this->host, &addy1) > 0)
+#endif
        {
                bool cached;
                HTTPResolver* r = new HTTPResolver(this, Server, url.domain, cached, (Module*)Mod);