diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 21:14:51 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 21:14:51 +0000 |
commit | bc282425088455198a7a99511c75914477d4ed32 (patch) | |
tree | 1b1fb887a634136a093deea7e4dd95d054201e7a /ext/lmdb-safe | |
parent | Releasing progress-linux version 1.8.3-3~progress7.99u1. (diff) | |
download | dnsdist-bc282425088455198a7a99511c75914477d4ed32.tar.xz dnsdist-bc282425088455198a7a99511c75914477d4ed32.zip |
Merging upstream version 1.9.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ext/lmdb-safe')
-rw-r--r-- | ext/lmdb-safe/lmdb-safe.cc | 7 | ||||
-rw-r--r-- | ext/lmdb-safe/lmdb-safe.hh | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/ext/lmdb-safe/lmdb-safe.cc b/ext/lmdb-safe/lmdb-safe.cc index 33c3d45..6729286 100644 --- a/ext/lmdb-safe/lmdb-safe.cc +++ b/ext/lmdb-safe/lmdb-safe.cc @@ -68,12 +68,17 @@ namespace LMDBLS { return (lsh->d_flags & LS_FLAG_DELETED) != 0; } + uint64_t LSgetTimestamp(std::string_view val) { + const LSheader* lsh = LSassertFixedHeaderSize(val); + + return lsh->getTimestamp(); + } bool s_flag_deleted{false}; } #endif /* #ifndef DNSDIST */ -MDBDbi::MDBDbi(MDB_env* env, MDB_txn* txn, const string_view dbname, int flags) +MDBDbi::MDBDbi(MDB_env* /* env */, MDB_txn* txn, const string_view dbname, int flags) : d_dbi(-1) { // A transaction that uses this function must finish (either commit or abort) before any other transaction in the process may use this function. diff --git a/ext/lmdb-safe/lmdb-safe.hh b/ext/lmdb-safe/lmdb-safe.hh index 2d5983b..1c62d88 100644 --- a/ext/lmdb-safe/lmdb-safe.hh +++ b/ext/lmdb-safe/lmdb-safe.hh @@ -140,7 +140,9 @@ namespace LMDBLS { return std::string((char*)this, sizeof(*this)) + std::string(ntohs(d_numextra)*8, '\0'); } - + uint64_t getTimestamp() const { + return _LMDB_SAFE_BSWAP64MAYBE(d_timestamp); + } }; static_assert(sizeof(LSheader)==24, "LSheader size is wrong"); @@ -154,6 +156,7 @@ namespace LMDBLS { size_t LScheckHeaderAndGetSize(std::string_view val, size_t datasize=0); size_t LScheckHeaderAndGetSize(const MDBOutVal *val, size_t datasize=0); bool LSisDeleted(std::string_view val); + uint64_t LSgetTimestamp(std::string_view val); extern bool s_flag_deleted; } |