From c841cc91276b0b588d6c141f88dff0f68034c858 Mon Sep 17 00:00:00 2001 From: Ciprian Dorin Craciun Date: Sun, 11 Sep 2022 13:38:02 +0300 Subject: [PATCH] [server] Always check CDB schema. --- sources/cmd/server/server.go | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/sources/cmd/server/server.go b/sources/cmd/server/server.go index e9bc913..b2dd11a 100644 --- a/sources/cmd/server/server.go +++ b/sources/cmd/server/server.go @@ -1386,16 +1386,6 @@ func main_0 () (error) { } } - - if _schemaVersion, _error := _cdbReader.GetWithCdbHash ([]byte (NamespaceSchemaVersion)); _error == nil { - if _schemaVersion == nil { - AbortError (nil, "[09316866] [cdb.....] missing archive schema version!") - } else if string (_schemaVersion) != CurrentSchemaVersion { - AbortError (nil, "[e6482cf7] [cdb.....] invalid archive schema version!") - } - } else { - AbortError (_error, "[87cae197] [cdb.....] failed opening archive!") - } } @@ -1407,6 +1397,23 @@ func main_0 () (error) { + + + + + if _schemaVersion, _error := _cdbReader.GetWithCdbHash ([]byte (NamespaceSchemaVersion)); _error == nil { + if _schemaVersion == nil { + AbortError (nil, "[09316866] [cdb.....] missing archive schema version!") + } else if string (_schemaVersion) != CurrentSchemaVersion { + AbortError (nil, "[e6482cf7] [cdb.....] invalid archive schema version!") + } + } else { + AbortError (_error, "[87cae197] [cdb.....] failed opening archive!") + } + + + + var _cachedReferences map[string][2]uint64 if _indexPaths { _cachedReferences = make (map[string][2]uint64, 128 * 1024)