Expand use of ENCRYPTION_ENABLED macro
This commit is contained in:
parent
57689e83d3
commit
17fce0596c
|
@ -77,14 +77,14 @@ Future<Reference<class IAsyncFile>> Net2FileSystem::open(const std::string& file
|
|||
static_cast<boost::asio::io_service*>((void*)g_network->global(INetwork::enASIOService)));
|
||||
if (FLOW_KNOBS->PAGE_WRITE_CHECKSUM_HISTORY > 0)
|
||||
f = map(f, [=](Reference<IAsyncFile> r) { return Reference<IAsyncFile>(new AsyncFileWriteChecker(r)); });
|
||||
#if (!defined(TLS_DISABLED) && !defined(_WIN32))
|
||||
#if ENCRYPTION_ENABLED
|
||||
if (flags & IAsyncFile::OPEN_ENCRYPTED)
|
||||
f = map(f, [flags](Reference<IAsyncFile> r) {
|
||||
auto mode = flags & IAsyncFile::OPEN_READWRITE ? AsyncFileEncrypted::Mode::APPEND_ONLY
|
||||
: AsyncFileEncrypted::Mode::READ_ONLY;
|
||||
return Reference<IAsyncFile>(new AsyncFileEncrypted(r, mode));
|
||||
});
|
||||
#endif
|
||||
#endif // ENCRYPTION_ENABLED
|
||||
return f;
|
||||
}
|
||||
|
||||
|
|
|
@ -2474,14 +2474,14 @@ Future<Reference<class IAsyncFile>> Sim2FileSystem::open(const std::string& file
|
|||
f = AsyncFileDetachable::open(f);
|
||||
if (FLOW_KNOBS->PAGE_WRITE_CHECKSUM_HISTORY > 0)
|
||||
f = map(f, [=](Reference<IAsyncFile> r) { return Reference<IAsyncFile>(new AsyncFileWriteChecker(r)); });
|
||||
#if (!defined(TLS_DISABLED) && !defined(_WIN32))
|
||||
#if ENCRYPTION_ENABLED
|
||||
if (flags & IAsyncFile::OPEN_ENCRYPTED)
|
||||
f = map(f, [flags](Reference<IAsyncFile> r) {
|
||||
auto mode = flags & IAsyncFile::OPEN_READWRITE ? AsyncFileEncrypted::Mode::APPEND_ONLY
|
||||
: AsyncFileEncrypted::Mode::READ_ONLY;
|
||||
return Reference<IAsyncFile>(new AsyncFileEncrypted(r, mode));
|
||||
});
|
||||
#endif
|
||||
#endif // ENCRYPTION_ENABLED
|
||||
return f;
|
||||
} else
|
||||
return AsyncFileCached::open(filename, flags, mode);
|
||||
|
|
Loading…
Reference in New Issue