Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions all_files.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@
<ClCompile Include="$(MSBuildThisFileDirectory)common\path_filter.cc" />
<ClCompile Include="$(MSBuildThisFileDirectory)common\path_filter_test.cc" />
<ClCompile Include="$(MSBuildThisFileDirectory)common\path_test.cc" />
<ClCompile Include="$(MSBuildThisFileDirectory)common\port_manager_test.cc" />
<ClCompile Include="$(MSBuildThisFileDirectory)common\port_manager_win.cc" />
<ClCompile Include="$(MSBuildThisFileDirectory)common\port_range_parser.cc" />
<ClCompile Include="$(MSBuildThisFileDirectory)common\port_range_parser_test.cc" />
<ClCompile Include="$(MSBuildThisFileDirectory)common\process_test.cc" />
<ClCompile Include="$(MSBuildThisFileDirectory)common\process_win.cc" />
<ClCompile Include="$(MSBuildThisFileDirectory)common\remote_util.cc" />
Expand Down Expand Up @@ -163,7 +159,6 @@
<ClInclude Include="$(MSBuildThisFileDirectory)common\ansi_filter.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)common\arch_type.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)common\build_version.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)common\port_range_parser.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)fastcdc\fastcdc.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)manifest\pending_assets_queue.h" />
</ItemGroup>
Expand Down Expand Up @@ -207,7 +202,6 @@
<ClInclude Include="$(MSBuildThisFileDirectory)common\path.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)common\path_filter.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)common\platform.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)common\port_manager.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)common\process.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)common\remote_util.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)common\scoped_handle_win.h" />
Expand Down
1 change: 0 additions & 1 deletion cdc_rsync/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ cc_library(
deps = [
":cdc_rsync_client",
"//common:build_version",
"//common:port_range_parser",
"@com_github_zstd//:zstd",
"@com_google_absl//absl/status",
],
Expand Down
1 change: 0 additions & 1 deletion cdc_rsync/params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "absl/strings/str_split.h"
#include "common/build_version.h"
#include "common/path.h"
#include "common/port_range_parser.h"
#include "common/remote_util.h"
#include "lib/zstd.h"

Expand Down
2 changes: 0 additions & 2 deletions cdc_stream/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ cc_library(
hdrs = ["base_command.h"],
deps = [
"//absl_helper:jedec_size_flag",
"//common:port_range_parser",
"@com_github_lyra//:lyra",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings:str_format",
Expand Down Expand Up @@ -210,7 +209,6 @@ cc_library(
"//common:log",
"//common:path",
"//common:path_filter",
"//common:port_manager",
"//common:process",
"//common:remote_util",
"//common:sdk_util",
Expand Down
6 changes: 1 addition & 5 deletions cdc_stream/asset_stream_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ void AssetStreamConfig::RegisterCommandLineFlags(lyra::command& cmd,
"asset stream service, default: " +
std::to_string(service_port_)));

cmd.add_argument(lyra::opt(base_command.PortRangeParser(
"--forward-port",
&session_cfg_.deprecated_forward_port_first,
&session_cfg_.deprecated_forward_port_last),
"port")
cmd.add_argument(lyra::opt(session_cfg_.deprecated_forward_port_range, "port")
.name("--forward-port")
.help("[Deprecated, ignored] TCP port or range used for "
"SSH port forwarding"));
Expand Down
13 changes: 0 additions & 13 deletions cdc_stream/base_command.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "absl/strings/str_format.h"
#include "absl/strings/str_split.h"
#include "absl_helper/jedec_size_flag.h"
#include "common/port_range_parser.h"
#include "lyra/lyra.hpp"

namespace cdc_ft {
Expand Down Expand Up @@ -57,18 +56,6 @@ std::function<void(const std::string&)> BaseCommand::JedecParser(
};
}

std::function<void(const std::string&)> BaseCommand::PortRangeParser(
const char* flag_name, uint16_t* first, uint16_t* last) {
return [flag_name, first, last,
error = &parse_error_](const std::string& value) {
if (!port_range::Parse(value.c_str(), first, last)) {
*error = absl::StrFormat(
"Failed to parse %s=%s, expected <port> or <port1>-<port2>",
flag_name, value);
}
};
}

std::function<void(const std::string&)> BaseCommand::PosArgValidator(
std::string* str) {
return [str, invalid_arg = &invalid_arg_](const std::string& value) {
Expand Down
7 changes: 0 additions & 7 deletions cdc_stream/base_command.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ class BaseCommand {
std::function<void(const std::string&)> JedecParser(const char* flag_name,
uint64_t* bytes);

// Parser for single ports "123" or port ranges "123-234". Usage:
// lyra::opt(PortRangeParser("port-flag", &first, &last), "port"))
// Automatically reports a parse failure on error.
std::function<void(const std::string&)> PortRangeParser(const char* flag_name,
uint16_t* first,
uint16_t* last);

// Validator that should be used for all positional arguments. Lyra interprets
// -u, --unknown_flag as positional argument. This validator makes sure that
// a positional argument starting with - is reported as an error. Otherwise,
Expand Down
1 change: 0 additions & 1 deletion cdc_stream/multi_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "common/path.h"
#include "common/path_filter.h"
#include "common/platform.h"
#include "common/port_manager.h"
#include "common/process.h"
#include "common/server_socket.h"
#include "common/util.h"
Expand Down
1 change: 0 additions & 1 deletion cdc_stream/session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include "cdc_stream/cdc_fuse_manager.h"
#include "common/log.h"
#include "common/port_manager.h"
#include "common/status.h"
#include "common/status_macros.h"
#include "metrics/enums.h"
Expand Down
3 changes: 1 addition & 2 deletions cdc_stream/session_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ struct SessionConfig {

// Ports used for local port forwarding. Deprecated as forward ports are
// determined automatically now using ephemeral ports.
uint16_t deprecated_forward_port_first = 0;
uint16_t deprecated_forward_port_last = 0;
std::string deprecated_forward_port_range;
};

} // namespace cdc_ft
Expand Down
48 changes: 0 additions & 48 deletions common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -300,54 +300,6 @@ cc_library(
hdrs = ["platform.h"],
)

cc_library(
name = "port_manager",
srcs = ["port_manager_win.cc"],
hdrs = ["port_manager.h"],
target_compatible_with = ["@platforms//os:windows"],
deps = [
":arch_type",
":remote_util",
":status",
":stopwatch",
":util",
"@com_google_absl//absl/status:statusor",
],
)

cc_test(
name = "port_manager_test",
srcs = ["port_manager_test.cc"],
target_compatible_with = ["@platforms//os:windows"],
deps = [
":port_manager",
":status_test_macros",
":stub_process",
":test_main",
":testing_clock",
"@com_google_googletest//:gtest",
],
)

cc_library(
name = "port_range_parser",
srcs = ["port_range_parser.cc"],
hdrs = ["port_range_parser.h"],
deps = [
"@com_google_absl//absl/strings",
],
)

cc_test(
name = "port_range_parser_test",
srcs = ["port_range_parser_test.cc"],
deps = [
":port_range_parser",
":test_main",
"@com_google_googletest//:gtest",
],
)

cc_library(
name = "process",
srcs = ["process_win.cc"],
Expand Down
113 changes: 0 additions & 113 deletions common/port_manager.h

This file was deleted.

Loading