]> git.mxchange.org Git - simgear.git/commitdiff
Fix some SVN errors/crashes.
authorJames Turner <zakalawe@mac.com>
Sat, 9 Nov 2013 15:22:15 +0000 (07:22 -0800)
committerJames Turner <zakalawe@mac.com>
Fri, 15 Nov 2013 11:47:36 +0000 (11:47 +0000)
simgear/io/SVNReportParser.cxx
simgear/io/SVNRepository.cxx

index 9a3077d269bf34fc731900f3523defa5d22fbcf3..b7f99d248fd369b29de21f26da5507b073b47a73 100644 (file)
@@ -417,15 +417,16 @@ public:
     } else if (!strcmp(name, SVN_DAV_MD5_CHECKSUM)) {
       // validate against (presumably) just written file
       if (decodedFileMd5 != md5Sum) {
+          SG_LOG(SG_GENERAL, SG_INFO, "checksum fail on:" << currentPath);
         fail(SVNRepository::SVN_ERROR_CHECKSUM);
       }
     } else if (!strcmp(name, SVN_OPEN_DIRECTORY_TAG)) {
+        currentDir->updateReportComplete();
         if (currentDir->parent()) {   
           // pop the collection stack
           currentDir = currentDir->parent();
         }
         
-        currentDir->updateReportComplete();
         currentPath = currentDir->fsPath();
     } else {
     //  std::cout << "element:" << name;
index cd0f378f72a6335ff2595605f63e5977961f6810..d3635fe811f884c376637b54e15f4feffb45d82e 100644 (file)
@@ -136,6 +136,7 @@ namespace { // anonmouse
             SG_LOG(SG_IO, SG_WARN, "request for:" << url() << 
                 " return code " << responseCode());
             _repo->propFindFailed(this, SVNRepository::SVN_ERROR_SOCKET);
+            _repo = NULL;
         }
       }
   
@@ -163,6 +164,7 @@ namespace { // anonmouse
         {
             HTTP::Request::onFail();
             _repo->propFindFailed(this, SVNRepository::SVN_ERROR_SOCKET);
+            _repo = NULL;
         }
         
     private:
@@ -244,15 +246,19 @@ protected:
     SVNRepository::ResultCode err = _parser.parseXML(s, n);
     if (err) {
         _failed = true;
-        SG_LOG(SG_IO, SG_WARN, "SVN: request for:" << url() << " failed:" << err);
+        SG_LOG(SG_IO, SG_WARN, _repo->p << ": SVN: request for:" << url() << " failed:" << err);
         _repo->updateFailed(this, err);
+        _repo = NULL;
     }
   }
 
     virtual void onFail()
     {
         HTTP::Request::onFail();
-        _repo->updateFailed(this, SVNRepository::SVN_ERROR_SOCKET);
+        if (_repo) {
+            _repo->updateFailed(this, SVNRepository::SVN_ERROR_SOCKET);
+            _repo = NULL;
+        }
     }
 private:
   SVNReportParser _parser;