]> git.mxchange.org Git - simgear.git/commitdiff
Add a bunch of debug messages to help fixing the Windows crash
authorTorsten Dreyer <torsten@t3r.de>
Wed, 4 May 2016 13:44:55 +0000 (15:44 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 13 Aug 2016 08:21:16 +0000 (10:21 +0200)
This patch should be reverted once the bug is fixed

simgear/io/HTTPRepository.cxx

index a99c36f5530ae23e9bf31c08889fca1ab0ac525e..f82a33f14460e4758fbc7d0f9b2e25fc95e09096 100644 (file)
@@ -306,25 +306,31 @@ public:
         PathList::const_iterator it = fsChildren.begin();
 
         for (; it != fsChildren.end(); ++it) {
+            SG_LOG(SG_TERRASYNC, SG_DEBUG, "processing child: '" << it->str() << "', isDir=" << it->isDir() );
             ChildInfo info(it->isDir() ? ChildInfo::DirectoryType : ChildInfo::FileType,
                            it->file().c_str(), NULL);
             std::string hash = hashForChild(info);
+            SG_LOG(SG_TERRASYNC, SG_DEBUG, "hash is: '" << hash << "'" );
 
             ChildInfoList::iterator c = findIndexChild(it->file());
             if (c == children.end()) {
+                SG_LOG(SG_TERRASYNC, SG_DEBUG, "is orphan '" << it->file() << "'" );
                 orphans.push_back(it->file());
             } else if (c->hash != hash) {
+                SG_LOG(SG_TERRASYNC, SG_DEBUG, "hash mismatch'" << it->file() << "', c->name=" << c->name );
                 // file exists, but hash mismatch, schedule update
                 if (!hash.empty()) {
-                    //SG_LOG(SG_TERRASYNC, SG_INFO, "file exists but hash is wrong for:" << c->name);
-                    //SG_LOG(SG_TERRASYNC, SG_INFO, "on disk:" << hash << " vs in info:" << c->hash);
+                    SG_LOG(SG_TERRASYNC, SG_DEBUG, "file exists but hash is wrong for:" << c->name);
+                    SG_LOG(SG_TERRASYNC, SG_DEBUG, "on disk:" << hash << " vs in info:" << c->hash);
                 }
 
                 toBeUpdated.push_back(c->name);
             } else {
                 // file exists and hash is valid. If it's a directory,
                 // perform a recursive check.
+                SG_LOG(SG_TERRASYNC, SG_DEBUG, "file exists hash is good:" << c->name);
                 if (c->type == ChildInfo::DirectoryType) {
+                    SG_LOG(SG_TERRASYNC, SG_DEBUG, "going recursive for:" << c->name);
                     SGPath p(relativePath());
                     p.append(c->name);
                     HTTPDirectory* childDir = _repository->getOrCreateDirectory(p.str());
@@ -334,8 +340,10 @@ public:
 
             // remove existing file system children from the index list,
             // so we can detect new children
+            SG_LOG(SG_TERRASYNC, SG_DEBUG, "looking for name in indexNames:" << c->name);
             string_list::iterator it = std::find(indexNames.begin(), indexNames.end(), c->name);
             if (it != indexNames.end()) {
+                SG_LOG(SG_TERRASYNC, SG_DEBUG, "found name in indexNames, erasing:" << c->name);
                 indexNames.erase(it);
             }
         } // of real children iteration