Fix some SVN errors/crashes.

This commit is contained in:
James Turner 2013-11-09 07:22:15 -08:00
parent c64776029e
commit e973e406a3
2 changed files with 10 additions and 3 deletions

View File

@ -417,15 +417,16 @@ public:
} else if (!strcmp(name, SVN_DAV_MD5_CHECKSUM)) { } else if (!strcmp(name, SVN_DAV_MD5_CHECKSUM)) {
// validate against (presumably) just written file // validate against (presumably) just written file
if (decodedFileMd5 != md5Sum) { if (decodedFileMd5 != md5Sum) {
SG_LOG(SG_GENERAL, SG_INFO, "checksum fail on:" << currentPath);
fail(SVNRepository::SVN_ERROR_CHECKSUM); fail(SVNRepository::SVN_ERROR_CHECKSUM);
} }
} else if (!strcmp(name, SVN_OPEN_DIRECTORY_TAG)) { } else if (!strcmp(name, SVN_OPEN_DIRECTORY_TAG)) {
currentDir->updateReportComplete();
if (currentDir->parent()) { if (currentDir->parent()) {
// pop the collection stack // pop the collection stack
currentDir = currentDir->parent(); currentDir = currentDir->parent();
} }
currentDir->updateReportComplete();
currentPath = currentDir->fsPath(); currentPath = currentDir->fsPath();
} else { } else {
// std::cout << "element:" << name; // std::cout << "element:" << name;

View File

@ -136,6 +136,7 @@ namespace { // anonmouse
SG_LOG(SG_IO, SG_WARN, "request for:" << url() << SG_LOG(SG_IO, SG_WARN, "request for:" << url() <<
" return code " << responseCode()); " return code " << responseCode());
_repo->propFindFailed(this, SVNRepository::SVN_ERROR_SOCKET); _repo->propFindFailed(this, SVNRepository::SVN_ERROR_SOCKET);
_repo = NULL;
} }
} }
@ -163,6 +164,7 @@ namespace { // anonmouse
{ {
HTTP::Request::onFail(); HTTP::Request::onFail();
_repo->propFindFailed(this, SVNRepository::SVN_ERROR_SOCKET); _repo->propFindFailed(this, SVNRepository::SVN_ERROR_SOCKET);
_repo = NULL;
} }
private: private:
@ -244,15 +246,19 @@ protected:
SVNRepository::ResultCode err = _parser.parseXML(s, n); SVNRepository::ResultCode err = _parser.parseXML(s, n);
if (err) { if (err) {
_failed = true; _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->updateFailed(this, err);
_repo = NULL;
} }
} }
virtual void onFail() virtual void onFail()
{ {
HTTP::Request::onFail(); HTTP::Request::onFail();
if (_repo) {
_repo->updateFailed(this, SVNRepository::SVN_ERROR_SOCKET); _repo->updateFailed(this, SVNRepository::SVN_ERROR_SOCKET);
_repo = NULL;
}
} }
private: private:
SVNReportParser _parser; SVNReportParser _parser;