summaryrefslogtreecommitdiff
path: root/src/pymscp.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/pymscp.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/pymscp.c')
-rw-r--r--src/pymscp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pymscp.c b/src/pymscp.c
index c36c662..6861ad8 100644
--- a/src/pymscp.c
+++ b/src/pymscp.c
@@ -109,6 +109,7 @@ static PyObject *wrap_mscp_init(PyObject *self, PyObject *args, PyObject *kw)
"cipher", /* const char * */
"hmac", /* const char * */
"compress", /* const char * */
+ "ccalgo", /* const char * */
"password", /* const char * */
"passphrase", /* const char * */
@@ -117,10 +118,10 @@ static PyObject *wrap_mscp_init(PyObject *self, PyObject *args, PyObject *kw)
"enable_nagle", /* bool */
NULL,
};
- const char *fmt = "si" "|" "ii" "kkk" "s" "iii" "ssss" "sssss" "ipp";
+ const char *fmt = "si" "|" "ii" "kkk" "s" "iii" "ssss" "ssssss" "ipp";
char *coremask = NULL;
char *login_name = NULL, *port = NULL, *config = NULL, *identity = NULL;
- char *cipher = NULL, *hmac = NULL, *compress = NULL;
+ char *cipher = NULL, *hmac = NULL, *compress = NULL, *ccalgo = NULL;
char *password = NULL, *passphrase = NULL;
struct instance *i;
@@ -154,6 +155,7 @@ static PyObject *wrap_mscp_init(PyObject *self, PyObject *args, PyObject *kw)
&cipher,
&hmac,
&compress,
+ &ccalgo,
&password,
&passphrase,
&i->so.debug_level,
@@ -179,6 +181,8 @@ static PyObject *wrap_mscp_init(PyObject *self, PyObject *args, PyObject *kw)
strncpy(i->so.hmac, hmac, MSCP_SSH_MAX_HMAC_STR - 1);
if (compress)
strncpy(i->so.compress, compress, MSCP_SSH_MAX_COMP_STR - 1);
+ if (ccalgo)
+ strncpy(i->so.ccalgo, ccalgo, MSCP_SSH_MAX_CCALGO_STR - 1);
if (password)
strncpy(i->so.password, password, MSCP_SSH_MAX_PASSWORD - 1);
if (passphrase)