]> git.mxchange.org Git - simgear.git/commitdiff
More HTTP repository compile tweaks.
authorJames Turner <zakalawe@mac.com>
Mon, 22 Feb 2016 19:07:01 +0000 (21:07 +0200)
committerJames Turner <zakalawe@mac.com>
Mon, 22 Feb 2016 19:07:16 +0000 (21:07 +0200)
simgear/io/HTTPRepository.cxx
simgear/io/test_HTTP.hxx
simgear/io/test_repository.cxx

index f4845b895ee58d5560f87485b50cd2a64bca6bf9..fc0913dfb4aab997cb3ca111e1a817d9dcd8b4e7 100644 (file)
@@ -198,12 +198,9 @@ public:
   {
       SGPath p(absolutePath());
       if (p.exists()) {
-// what is indexValid for?
-//          bool indexValid = false;
           try {
               // already exists on disk
               parseDirIndex(children);
-//              indexValid = true;
               std::sort(children.begin(), children.end());
           } catch (sg_exception& e) {
               // parsing cache failed
@@ -386,7 +383,7 @@ private:
     {
         SGPath p(absolutePath());
         p.append(".dirindex");
-        std::ifstream indexStream( p.str().c_str(), std::ios::in );
+        std::ifstream indexStream( p.c_str(), std::ios::in );
 
         if ( !indexStream.is_open() ) {
             throw sg_io_exception("cannot open dirIndex file", p);
@@ -635,7 +632,7 @@ HTTPRepository::failure() const
 
                     // dir index data has changed, so write to disk and update
                     // the hash accordingly
-                    std::ofstream of(pathInRepo().str().c_str(), std::ios::trunc | std::ios::out);
+                    std::ofstream of(pathInRepo().c_str(), std::ios::trunc | std::ios::out);
                     assert(of.is_open());
                     of.write(body.data(), body.size());
                     of.close();
@@ -774,7 +771,7 @@ HTTPRepository::failure() const
         SGPath cachePath = basePath;
         cachePath.append(".hashes");
 
-        std::ofstream stream(cachePath.str().c_str(),std::ios::out | std::ios::trunc);
+        std::ofstream stream(cachePath.c_str(),std::ios::out | std::ios::trunc);
         HashCache::const_iterator it;
         for (it = hashes.begin(); it != hashes.end(); ++it) {
             stream << it->filePath << ":" << it->modTime << ":"
@@ -792,7 +789,7 @@ HTTPRepository::failure() const
             return;
         }
 
-        std::ifstream stream(cachePath.str().c_str(), std::ios::in);
+        std::ifstream stream(cachePath.c_str(), std::ios::in);
         char buf[2048];
         char* lastToken;
 
index e7a7c286a5e08e6b853b862fe8a598a4cb99dff2..6d8861ed9f8a522e996849be00a9b7bff10207c7 100644 (file)
@@ -181,7 +181,7 @@ public:
 
         open();
         bind(NULL, 2000); // localhost, any port
-        listen(5);
+        listen(16);
 
         _poller.addChannel(this);
     }
index 382df746d496ca1113ad2245282e0f296635f027..743d1a724a98b96d0cfe6c70d06e2814fac2c71e 100644 (file)
@@ -300,7 +300,7 @@ void createFile(const SGPath& basePath, const std::string& relPath, int revision
 
     std::string prName = comps.at(comps.size() - 2);
     {
-        std::ofstream f(p.str().c_str(), std::ios::trunc | std::ios::out);
+        std::ofstream f(p.c_str(), std::ios::trunc | std::ios::out);
         f << dataForFile(prName, comps.back(), revision);
     }
 }
@@ -378,7 +378,7 @@ void testModifyLocalFiles(HTTP::Client* cl)
     SGPath modFile(p);
     modFile.append("dirB/subdirA/fileBAA");
     {
-        std::ofstream of(modFile.str().c_str(), std::ios::out | std::ios::trunc);
+        std::ofstream of(modFile.c_str(), std::ios::out | std::ios::trunc);
         of << "complete nonsense";
         of.close();
     }