]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_http_client.cpp
Next part of Development/Hooking (see wiki)
[user/henk/code/inspircd.git] / src / modules / m_http_client.cpp
index aa97242e05cd98bc7b6d5fbdeabde180ce7265cf..3f424b5955686605783d72eea357aeec6e768ae7 100644 (file)
@@ -24,7 +24,7 @@ class URL
        int port;
 };
 
-class HTTPSocket : public InspSocket
+class HTTPSocket : public BufferedSocket
 {
  private:
        InspIRCd *Server;
@@ -111,7 +111,7 @@ class ModuleHTTPClient : public Module
 };
 
 HTTPSocket::HTTPSocket(InspIRCd *Instance, ModuleHTTPClient *Mod)
-               : InspSocket(Instance), Server(Instance), Mod(Mod), status(HTTP_CLOSED)
+               : BufferedSocket(Instance), Server(Instance), Mod(Mod), status(HTTP_CLOSED)
 {
        this->ClosePending = false;
        this->port = 80;
@@ -176,10 +176,10 @@ bool HTTPSocket::ParseURL(const std::string &iurl)
        
        for (int p = 0;; p++)
        {
-               std::string part = tokenizer.GetToken();
-               if (part.empty() && tokenizer.StreamEnd())
+               std::string part;
+               if (!tokenizer.GetToken(part))
                        break;
-               
+
                if ((p == 0) && (part[part.length() - 1] == ':'))
                {
                        // Protocol ('http:')