mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
fullnode: support for TCP master/slave replication
This commit is contained in:
parent
bfa166d66c
commit
f40822b58a
50 changed files with 1109 additions and 244 deletions
|
@ -1,5 +1,7 @@
|
|||
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
|
||||
|
||||
option(TDUTILS_MIME_TYPE "Generate mime types conversion (gperf is required)" ON)
|
||||
|
||||
if (WIN32)
|
||||
if (WINGETOPT_FOUND)
|
||||
set(TD_HAVE_GETOPT 1)
|
||||
|
@ -96,7 +98,6 @@ set(TDUTILS_SOURCE
|
|||
td/utils/JsonBuilder.cpp
|
||||
td/utils/logging.cpp
|
||||
td/utils/misc.cpp
|
||||
td/utils/MimeType.cpp
|
||||
td/utils/MpmcQueue.cpp
|
||||
td/utils/OptionsParser.cpp
|
||||
td/utils/Random.cpp
|
||||
|
@ -202,7 +203,6 @@ set(TDUTILS_SOURCE
|
|||
td/utils/List.h
|
||||
td/utils/logging.h
|
||||
td/utils/MemoryLog.h
|
||||
td/utils/MimeType.h
|
||||
td/utils/misc.h
|
||||
td/utils/MovableValue.h
|
||||
td/utils/MpmcQueue.h
|
||||
|
@ -251,6 +251,14 @@ set(TDUTILS_SOURCE
|
|||
td/utils/VectorQueue.h
|
||||
)
|
||||
|
||||
if (TDUTILS_MIME_TYPE)
|
||||
set(TDUTILS_SOURCE
|
||||
${TDUTILS_SOURCE}
|
||||
td/utils/MimeType.cpp
|
||||
td/utils/MimeType.h
|
||||
)
|
||||
endif()
|
||||
|
||||
set(TDUTILS_TEST_SOURCE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test/buffer.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test/ConcurrentHashMap.cpp
|
||||
|
@ -284,7 +292,7 @@ if (WIN32)
|
|||
# target_link_libraries(tdutils PRIVATE ${WS2_32_LIBRARY} ${MSWSOCK_LIBRARY})
|
||||
target_link_libraries(tdutils PRIVATE ws2_32 Mswsock Normaliz)
|
||||
endif()
|
||||
if (NOT CMAKE_CROSSCOMPILING)
|
||||
if (NOT CMAKE_CROSSCOMPILING AND TDUTILS_MIME_TYPE)
|
||||
add_dependencies(tdutils tdmime_auto)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
|
|||
# Generates files for MIME type <-> extension conversions
|
||||
# DEPENDS ON: gperf grep bash/powershell
|
||||
|
||||
if (NOT TDUTILS_MIME_TYPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
file(MAKE_DIRECTORY auto)
|
||||
|
||||
set(TDMIME_SOURCE
|
||||
|
|
|
@ -168,8 +168,9 @@ class TlParser {
|
|||
data += sizeof(int32);
|
||||
} else {
|
||||
check_len(sizeof(int32));
|
||||
result_len = data[1] + (data[2] << 8) + (data[3] << 16) + (data[4] << 24) + (static_cast<uint64>(data[5]) << 32) +
|
||||
(static_cast<uint64>(data[6]) << 40) + (static_cast<uint64>(data[7]) << 48);
|
||||
result_len = narrow_cast<size_t>(data[1] + (data[2] << 8) + (data[3] << 16) + (data[4] << 24) +
|
||||
(static_cast<uint64>(data[5]) << 32) + (static_cast<uint64>(data[6]) << 40) +
|
||||
(static_cast<uint64>(data[7]) << 48));
|
||||
if (result_len > std::numeric_limits<size_t>::max() - 3) {
|
||||
set_error("Too big string found");
|
||||
return T();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue