Skip to content

Commit 174f8e9

Browse files
committed
Implement port forwarding session type.
1 parent 96d61f1 commit 174f8e9

File tree

140 files changed

+14587
-7628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+14587
-7628
lines changed

source/base/logging.cc

+15-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include "base/system_time.h"
2525
#include "base/strings/string_number_conversions.h"
2626
#include "base/strings/unicode.h"
27-
2827
#include <fstream>
2928
#include <iomanip>
3029
#include <mutex>
@@ -338,6 +337,21 @@ void shutdownLogging()
338337
g_log_file.close();
339338
}
340339

340+
//--------------------------------------------------------------------------------------------------
341+
std::filesystem::path loggingDirectory()
342+
{
343+
if (g_log_dir_path.empty())
344+
return defaultLogFileDir();
345+
346+
return g_log_dir_path;
347+
}
348+
349+
//--------------------------------------------------------------------------------------------------
350+
std::filesystem::path loggingFile()
351+
{
352+
return g_log_file_path;
353+
}
354+
341355
//--------------------------------------------------------------------------------------------------
342356
bool shouldCreateLogMessage(LoggingSeverity severity)
343357
{

source/base/logging.h

+3
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ bool initLogging(const LoggingSettings& settings = LoggingSettings());
148148
// guarantee that it will stay closed after this call.
149149
void shutdownLogging();
150150

151+
std::filesystem::path loggingDirectory();
152+
std::filesystem::path loggingFile();
153+
151154
// Used by LOG_IS_ON to lazy-evaluate stream arguments.
152155
bool shouldCreateLogMessage(LoggingSeverity severity);
153156

source/client/CMakeLists.txt

+12
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ list(APPEND SOURCE_CLIENT_CORE
2929
client_file_transfer.h
3030
client_main.cc
3131
client_main.h
32+
client_port_forwarding.cc
33+
client_port_forwarding.h
3234
client_proxy.cc
3335
client_proxy.h
3436
client_system_info.cc
@@ -70,6 +72,9 @@ list(APPEND SOURCE_CLIENT_CORE
7072
frame_factory.h
7173
input_event_filter.cc
7274
input_event_filter.h
75+
port_forwarding_window.h
76+
port_forwarding_window_proxy.cc
77+
port_forwarding_window_proxy.h
7378
router.cc
7479
router.h
7580
router_proxy.cc
@@ -194,6 +199,11 @@ list(APPEND SOURCE_CLIENT_CORE_UI_FILE_TRANSFER
194199
ui/file_transfer/qt_file_manager_window.h
195200
ui/file_transfer/qt_file_manager_window.ui)
196201

202+
list(APPEND SOURCE_CLIENT_CORE_UI_PORT_FORWARDING
203+
ui/port_forwarding/qt_port_forwarding_window.cc
204+
ui/port_forwarding/qt_port_forwarding_window.h
205+
ui/port_forwarding/qt_port_forwarding_window.ui)
206+
197207
list(APPEND SOURCE_CLIENT_CORE_UI_ROUTER_MANAGER
198208
ui/router_manager/router_manager_window.cc
199209
ui/router_manager/router_manager_window.h
@@ -282,6 +292,7 @@ source_group(online_checker FILES ${SOURCE_CLIENT_CORE_ONLINE_CHECKER})
282292
source_group(ui FILES ${SOURCE_CLIENT_CORE_UI})
283293
source_group(ui\\desktop FILES ${SOURCE_CLIENT_CORE_UI_DESKTOP})
284294
source_group(ui\\file_transfer FILES ${SOURCE_CLIENT_CORE_UI_FILE_TRANSFER})
295+
source_group(ui\\port_forwarding FILES ${SOURCE_CLIENT_CORE_UI_PORT_FORWARDING})
285296
source_group(ui\\router_manager FILES ${SOURCE_CLIENT_CORE_UI_ROUTER_MANAGER})
286297
source_group(ui\\sys_info FILES ${SOURCE_CLIENT_CORE_UI_SYS_INFO})
287298
source_group(ui\\text_chat FILES ${SOURCE_CLIENT_CORE_UI_TEXT_CHAT})
@@ -293,6 +304,7 @@ add_library(aspia_client_core STATIC
293304
${SOURCE_CLIENT_CORE_UI}
294305
${SOURCE_CLIENT_CORE_UI_DESKTOP}
295306
${SOURCE_CLIENT_CORE_UI_FILE_TRANSFER}
307+
${SOURCE_CLIENT_CORE_UI_PORT_FORWARDING}
296308
${SOURCE_CLIENT_CORE_UI_ROUTER_MANAGER}
297309
${SOURCE_CLIENT_CORE_UI_SYS_INFO}
298310
${SOURCE_CLIENT_CORE_UI_TEXT_CHAT})

source/client/client_main.cc

+4
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,10 @@ int clientMain(int argc, char* argv[])
584584
{
585585
config.session_type = proto::SESSION_TYPE_TEXT_CHAT;
586586
}
587+
else if (session_type == "port-forwarding")
588+
{
589+
config.session_type = proto::SESSION_TYPE_PORT_FORWARDING;
590+
}
587591
else
588592
{
589593
LOG(LS_ERROR) << "Unknown session type specified: " << session_type;

0 commit comments

Comments
 (0)