]> git.mxchange.org Git - simgear.git/blobdiff - simgear/package/Install.cxx
Tweak HTTP code to always sleep.
[simgear.git] / simgear / package / Install.cxx
index a702b0efae597e704fd896cde28beaf8ebfb7b50..d513786c27e605ebe5dc34e18d2bbebe1cf9d1e3 100644 (file)
@@ -69,19 +69,19 @@ protected:
         Dir d(m_extractPath);
         d.create(0755);        
         
-        memset(&m_md5, 0, sizeof(MD5_CTX));
-        MD5Init(&m_md5);
+        memset(&m_md5, 0, sizeof(SG_MD5_CTX));
+        SG_MD5Init(&m_md5);
     }
     
     virtual void gotBodyData(const char* s, int n)
     {
         m_buffer += std::string(s, n);
-        MD5Update(&m_md5, (unsigned char*) s, n);
+        SG_MD5Update(&m_md5, (unsigned char*) s, n);
         
         m_owner->installProgress(m_buffer.size(), responseLength());
     }
     
-    virtual void responseComplete()
+    virtual void onDone()
     {
         if (responseCode() != 200) {
             SG_LOG(SG_GENERAL, SG_ALERT, "download failure");
@@ -89,7 +89,7 @@ protected:
             return;
         }
 
-        MD5Final(&m_md5);
+        SG_MD5Final(&m_md5);
     // convert final sum to hex
         const char hexChar[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
         std::stringstream hexMd5;
@@ -248,7 +248,7 @@ private:
     
     Install* m_owner;
     string_list m_urls;
-    MD5_CTX m_md5;
+    SG_MD5_CTX m_md5;
     std::string m_buffer;
     SGPath m_extractPath;
 };
@@ -306,7 +306,7 @@ void Install::startUpdate()
     }
     
     m_download = new PackageArchiveDownloader(this);
-    m_package->catalog()->root()->getHTTPClient()->makeRequest(m_download);
+    m_package->catalog()->root()->makeHTTPRequest(m_download);
     m_package->catalog()->root()->startInstall(this);
 }