Skip to content

Commit b767fe5

Browse files
committed
add invalid address check
1 parent 6d03c34 commit b767fe5

File tree

4 files changed

+212
-1
lines changed

4 files changed

+212
-1
lines changed

dcc_client/dcc_client/P2PClient.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ void P2P::ListenerThread(int update_interval)
297297
continue;
298298
}
299299

300+
// If at this point the other address is still not known, do not continue
301+
if (otherAddrStr == "" || otherAddrStr == "0.0.0.0:0")
302+
continue;
303+
300304
// Read the received data buffer into a string
301305
std::string textVal = std::string(buffer, buffer + iResult);
302306

@@ -384,7 +388,7 @@ void P2P::ListenerThread(int update_interval)
384388

385389
// If the peer is requesting to connect
386390
if (StringStartsWith(totalMessage, "peer~connect")) {
387-
role = 0;
391+
role = 1;
388392
if (WalletSettingValues::verbose >= 4) {
389393
console::DebugPrint();
390394
console::WriteLine("Received initial connection from (" + otherAddrStr + ")", console::greenFGColor, "");

dcc_client/out-linux/_deps/curl-build/libcurl-target.cmake

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,6 +2461,213 @@ unset(_cmake_targets_not_defined)
24612461
unset(_cmake_expected_targets)
24622462

24632463

2464+
# Create imported target CURL::libcurl
2465+
add_library(CURL::libcurl SHARED IMPORTED)
2466+
2467+
set_target_properties(CURL::libcurl PROPERTIES
2468+
INTERFACE_INCLUDE_DIRECTORIES "/home/sam/Code/Distributed-Compute-Coin/dcc_client/out-linux/_deps/curl-src/include"
2469+
INTERFACE_LINK_LIBRARIES "dl;OpenSSL::SSL;OpenSSL::Crypto;ZLIB::ZLIB"
2470+
)
2471+
2472+
# Import target "CURL::libcurl" for configuration "Release"
2473+
set_property(TARGET CURL::libcurl APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
2474+
set_target_properties(CURL::libcurl PROPERTIES
2475+
IMPORTED_LOCATION_RELEASE "/home/sam/Code/Distributed-Compute-Coin/dcc_client/out-linux/_deps/curl-build/lib/libcurl.so"
2476+
IMPORTED_SONAME_RELEASE "libcurl.so"
2477+
)
2478+
2479+
# This file does not depend on other imported targets which have
2480+
# been exported from the same project but in a separate export set.
2481+
2482+
# Commands beyond this point should not need to know the version.
2483+
set(CMAKE_IMPORT_FILE_VERSION)
2484+
cmake_policy(POP)
2485+
# Generated by CMake
2486+
2487+
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
2488+
message(FATAL_ERROR "CMake >= 2.8.0 required")
2489+
endif()
2490+
if(CMAKE_VERSION VERSION_LESS "2.8.3")
2491+
message(FATAL_ERROR "CMake >= 2.8.3 required")
2492+
endif()
2493+
cmake_policy(PUSH)
2494+
cmake_policy(VERSION 2.8.3...3.23)
2495+
#----------------------------------------------------------------
2496+
# Generated CMake target import file.
2497+
#----------------------------------------------------------------
2498+
2499+
# Commands may need to know the format version.
2500+
set(CMAKE_IMPORT_FILE_VERSION 1)
2501+
2502+
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
2503+
set(_cmake_targets_defined "")
2504+
set(_cmake_targets_not_defined "")
2505+
set(_cmake_expected_targets "")
2506+
foreach(_cmake_expected_target IN ITEMS CURL::libcurl)
2507+
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
2508+
if(TARGET "${_cmake_expected_target}")
2509+
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
2510+
else()
2511+
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
2512+
endif()
2513+
endforeach()
2514+
unset(_cmake_expected_target)
2515+
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
2516+
unset(_cmake_targets_defined)
2517+
unset(_cmake_targets_not_defined)
2518+
unset(_cmake_expected_targets)
2519+
unset(CMAKE_IMPORT_FILE_VERSION)
2520+
cmake_policy(POP)
2521+
return()
2522+
endif()
2523+
if(NOT _cmake_targets_defined STREQUAL "")
2524+
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
2525+
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
2526+
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
2527+
endif()
2528+
unset(_cmake_targets_defined)
2529+
unset(_cmake_targets_not_defined)
2530+
unset(_cmake_expected_targets)
2531+
2532+
2533+
# Create imported target CURL::libcurl
2534+
add_library(CURL::libcurl SHARED IMPORTED)
2535+
2536+
set_target_properties(CURL::libcurl PROPERTIES
2537+
INTERFACE_INCLUDE_DIRECTORIES "/home/sam/Code/Distributed-Compute-Coin/dcc_client/out-linux/_deps/curl-src/include"
2538+
INTERFACE_LINK_LIBRARIES "dl;OpenSSL::SSL;OpenSSL::Crypto;ZLIB::ZLIB"
2539+
)
2540+
2541+
# Import target "CURL::libcurl" for configuration "Release"
2542+
set_property(TARGET CURL::libcurl APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
2543+
set_target_properties(CURL::libcurl PROPERTIES
2544+
IMPORTED_LOCATION_RELEASE "/home/sam/Code/Distributed-Compute-Coin/dcc_client/out-linux/_deps/curl-build/lib/libcurl.so"
2545+
IMPORTED_SONAME_RELEASE "libcurl.so"
2546+
)
2547+
2548+
# This file does not depend on other imported targets which have
2549+
# been exported from the same project but in a separate export set.
2550+
2551+
# Commands beyond this point should not need to know the version.
2552+
set(CMAKE_IMPORT_FILE_VERSION)
2553+
cmake_policy(POP)
2554+
# Generated by CMake
2555+
2556+
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
2557+
message(FATAL_ERROR "CMake >= 2.8.0 required")
2558+
endif()
2559+
if(CMAKE_VERSION VERSION_LESS "2.8.3")
2560+
message(FATAL_ERROR "CMake >= 2.8.3 required")
2561+
endif()
2562+
cmake_policy(PUSH)
2563+
cmake_policy(VERSION 2.8.3...3.23)
2564+
#----------------------------------------------------------------
2565+
# Generated CMake target import file.
2566+
#----------------------------------------------------------------
2567+
2568+
# Commands may need to know the format version.
2569+
set(CMAKE_IMPORT_FILE_VERSION 1)
2570+
2571+
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
2572+
set(_cmake_targets_defined "")
2573+
set(_cmake_targets_not_defined "")
2574+
set(_cmake_expected_targets "")
2575+
foreach(_cmake_expected_target IN ITEMS CURL::libcurl)
2576+
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
2577+
if(TARGET "${_cmake_expected_target}")
2578+
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
2579+
else()
2580+
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
2581+
endif()
2582+
endforeach()
2583+
unset(_cmake_expected_target)
2584+
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
2585+
unset(_cmake_targets_defined)
2586+
unset(_cmake_targets_not_defined)
2587+
unset(_cmake_expected_targets)
2588+
unset(CMAKE_IMPORT_FILE_VERSION)
2589+
cmake_policy(POP)
2590+
return()
2591+
endif()
2592+
if(NOT _cmake_targets_defined STREQUAL "")
2593+
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
2594+
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
2595+
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
2596+
endif()
2597+
unset(_cmake_targets_defined)
2598+
unset(_cmake_targets_not_defined)
2599+
unset(_cmake_expected_targets)
2600+
2601+
2602+
# Create imported target CURL::libcurl
2603+
add_library(CURL::libcurl SHARED IMPORTED)
2604+
2605+
set_target_properties(CURL::libcurl PROPERTIES
2606+
INTERFACE_INCLUDE_DIRECTORIES "/home/sam/Code/Distributed-Compute-Coin/dcc_client/out-linux/_deps/curl-src/include"
2607+
INTERFACE_LINK_LIBRARIES "dl;OpenSSL::SSL;OpenSSL::Crypto;ZLIB::ZLIB"
2608+
)
2609+
2610+
# Import target "CURL::libcurl" for configuration "Release"
2611+
set_property(TARGET CURL::libcurl APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
2612+
set_target_properties(CURL::libcurl PROPERTIES
2613+
IMPORTED_LOCATION_RELEASE "/home/sam/Code/Distributed-Compute-Coin/dcc_client/out-linux/_deps/curl-build/lib/libcurl.so"
2614+
IMPORTED_SONAME_RELEASE "libcurl.so"
2615+
)
2616+
2617+
# This file does not depend on other imported targets which have
2618+
# been exported from the same project but in a separate export set.
2619+
2620+
# Commands beyond this point should not need to know the version.
2621+
set(CMAKE_IMPORT_FILE_VERSION)
2622+
cmake_policy(POP)
2623+
# Generated by CMake
2624+
2625+
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
2626+
message(FATAL_ERROR "CMake >= 2.8.0 required")
2627+
endif()
2628+
if(CMAKE_VERSION VERSION_LESS "2.8.3")
2629+
message(FATAL_ERROR "CMake >= 2.8.3 required")
2630+
endif()
2631+
cmake_policy(PUSH)
2632+
cmake_policy(VERSION 2.8.3...3.23)
2633+
#----------------------------------------------------------------
2634+
# Generated CMake target import file.
2635+
#----------------------------------------------------------------
2636+
2637+
# Commands may need to know the format version.
2638+
set(CMAKE_IMPORT_FILE_VERSION 1)
2639+
2640+
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
2641+
set(_cmake_targets_defined "")
2642+
set(_cmake_targets_not_defined "")
2643+
set(_cmake_expected_targets "")
2644+
foreach(_cmake_expected_target IN ITEMS CURL::libcurl)
2645+
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
2646+
if(TARGET "${_cmake_expected_target}")
2647+
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
2648+
else()
2649+
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
2650+
endif()
2651+
endforeach()
2652+
unset(_cmake_expected_target)
2653+
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
2654+
unset(_cmake_targets_defined)
2655+
unset(_cmake_targets_not_defined)
2656+
unset(_cmake_expected_targets)
2657+
unset(CMAKE_IMPORT_FILE_VERSION)
2658+
cmake_policy(POP)
2659+
return()
2660+
endif()
2661+
if(NOT _cmake_targets_defined STREQUAL "")
2662+
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
2663+
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
2664+
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
2665+
endif()
2666+
unset(_cmake_targets_defined)
2667+
unset(_cmake_targets_not_defined)
2668+
unset(_cmake_expected_targets)
2669+
2670+
24642671
# Create imported target CURL::libcurl
24652672
add_library(CURL::libcurl SHARED IMPORTED)
24662673

Binary file not shown.
-144 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)