summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2023-09-09 14:32:15 +0900
committerRyo Nakamura <upa@haeena.net>2023-11-01 19:54:18 +0900
commitbf74aa095adf8d0a3b4144b29b2d7a48fe4e02b2 (patch)
treed3d58b31457af827cecf439b902e14b62d41c129 /src/main.c
parenta88471fc43a8500f73cd55eeb87b3a990cb0b4f9 (diff)
add -g option to specify TCP cc algorithm
This commit introduce SSH_OPTIONS_CCALGO option to the libssh patch and add -g CONGESTION option to mscp.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index cbd2574..8a229dd 100644
--- a/src/main.c
+++ b/src/main.c
@@ -21,7 +21,8 @@ void usage(bool print_help) {
"Usage: mscp [vqDHdNh] [-n nr_conns] [-m coremask] [-u max_startups]\n"
" [-s min_chunk_sz] [-S max_chunk_sz] [-a nr_ahead] [-b buf_sz]\n"
" [-l login_name] [-p port] [-F ssh_config] [-i identity_file]\n"
- " [-c cipher_spec] [-M hmac_spec] [-C compress] source ... target\n"
+ " [-c cipher_spec] [-M hmac_spec] [-C compress] [-g congestion]\n"
+ " source ... target\n"
"\n");
if (!print_help)
@@ -51,6 +52,7 @@ void usage(bool print_help) {
" -M HMAC hmac spec\n"
" -C COMPRESS enable compression: "
"yes, no, zlib, zlib@openssh.com\n"
+ " -g CONGESTION specify TCP congestion control algorithm\n"
" -H disable hostkey check\n"
" -d increment ssh debug output level\n"
" -N enable Nagle's algorithm (default disabled)\n"
@@ -202,7 +204,8 @@ int main(int argc, char **argv)
memset(&o, 0, sizeof(o));
o.severity = MSCP_SEVERITY_WARN;
- while ((ch = getopt(argc, argv, "n:m:u:s:S:a:b:vqDrl:p:i:F:c:M:C:HdNh")) != -1) {
+ while ((ch = getopt(argc, argv,
+ "n:m:u:s:S:a:b:vqDrl:p:i:F:c:M:C:g:HdNh")) != -1) {
switch (ch) {
case 'n':
o.nr_threads = atoi(optarg);
@@ -287,6 +290,13 @@ int main(int argc, char **argv)
}
strncpy(s.compress, optarg, MSCP_SSH_MAX_COMP_STR);
break;
+ case 'g':
+ if (strlen(optarg) > MSCP_SSH_MAX_CCALGO_STR - 1) {
+ fprintf(stderr, "long ccalgo string: %s\n", optarg);
+ return -1;
+ }
+ strncpy(s.ccalgo, optarg, MSCP_SSH_MAX_CCALGO_STR);
+ break;
case 'H':
s.no_hostkey_check = true;
break;