feat(api): Provide API access to --commit-timeout. (#1001)
Fixes #1000. Part of #595.
Этот коммит содержится в:
родитель
2609dd7123
Коммит
de848cffad
@ -344,6 +344,12 @@ iperf_get_test_no_delay(struct iperf_test *ipt)
|
|||||||
return ipt->no_delay;
|
return ipt->no_delay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
iperf_get_test_connect_timeout(struct iperf_test *ipt)
|
||||||
|
{
|
||||||
|
return ipt->settings->connect_timeout;
|
||||||
|
}
|
||||||
|
|
||||||
/************** Setter routines for some fields inside iperf_test *************/
|
/************** Setter routines for some fields inside iperf_test *************/
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -627,6 +633,13 @@ iperf_set_test_no_delay(struct iperf_test* ipt, int no_delay)
|
|||||||
ipt->no_delay = no_delay;
|
ipt->no_delay = no_delay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
iperf_set_test_connect_timeout(struct iperf_test* ipt, int ct)
|
||||||
|
{
|
||||||
|
ipt->settings->connect_timeout = ct;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/********************** Get/set test protocol structure ***********************/
|
/********************** Get/set test protocol structure ***********************/
|
||||||
|
|
||||||
struct protocol *
|
struct protocol *
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* iperf, Copyright (c) 2014-2019, The Regents of the University of
|
* iperf, Copyright (c) 2014-2020, The Regents of the University of
|
||||||
* California, through Lawrence Berkeley National Laboratory (subject
|
* California, through Lawrence Berkeley National Laboratory (subject
|
||||||
* to receipt of any required approvals from the U.S. Dept. of
|
* to receipt of any required approvals from the U.S. Dept. of
|
||||||
* Energy). All rights reserved.
|
* Energy). All rights reserved.
|
||||||
@ -128,6 +128,7 @@ int iperf_get_test_tos( struct iperf_test* ipt );
|
|||||||
char* iperf_get_extra_data( struct iperf_test* ipt );
|
char* iperf_get_extra_data( struct iperf_test* ipt );
|
||||||
char* iperf_get_iperf_version(void);
|
char* iperf_get_iperf_version(void);
|
||||||
int iperf_get_test_no_delay( struct iperf_test* ipt );
|
int iperf_get_test_no_delay( struct iperf_test* ipt );
|
||||||
|
int iperf_get_test_connect_timeout( struct iperf_test* ipt );
|
||||||
|
|
||||||
/* Setter routines for some fields inside iperf_test. */
|
/* Setter routines for some fields inside iperf_test. */
|
||||||
void iperf_set_verbose( struct iperf_test* ipt, int verbose );
|
void iperf_set_verbose( struct iperf_test* ipt, int verbose );
|
||||||
@ -172,6 +173,8 @@ void iperf_set_test_server_authorized_users(struct iperf_test *ipt, char *ser
|
|||||||
void iperf_set_test_server_rsa_privkey(struct iperf_test *ipt, char *server_rsa_privkey_base64);
|
void iperf_set_test_server_rsa_privkey(struct iperf_test *ipt, char *server_rsa_privkey_base64);
|
||||||
#endif // HAVE_SSL
|
#endif // HAVE_SSL
|
||||||
|
|
||||||
|
void iperf_set_test_connect_timeout(struct iperf_test *ipt, int ct);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exchange_parameters - handles the param_Exchange part for client
|
* exchange_parameters - handles the param_Exchange part for client
|
||||||
*
|
*
|
||||||
|
14
src/t_api.c
14
src/t_api.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* iperf, Copyright (c) 2017, The Regents of the University of
|
* iperf, Copyright (c) 2017-2020, The Regents of the University of
|
||||||
* California, through Lawrence Berkeley National Laboratory (subject
|
* California, through Lawrence Berkeley National Laboratory (subject
|
||||||
* to receipt of any required approvals from the U.S. Dept. of
|
* to receipt of any required approvals from the U.S. Dept. of
|
||||||
* Energy). All rights reserved.
|
* Energy). All rights reserved.
|
||||||
@ -45,9 +45,21 @@ int
|
|||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
const char *ver;
|
const char *ver;
|
||||||
|
struct iperf_test *test;
|
||||||
|
int sint, gint;
|
||||||
|
|
||||||
ver = iperf_get_iperf_version();
|
ver = iperf_get_iperf_version();
|
||||||
assert(strcmp(ver, IPERF_VERSION) == 0);
|
assert(strcmp(ver, IPERF_VERSION) == 0);
|
||||||
|
|
||||||
|
test = iperf_new_test();
|
||||||
|
assert(test != NULL);
|
||||||
|
|
||||||
|
iperf_defaults(test);
|
||||||
|
|
||||||
|
sint = 10;
|
||||||
|
iperf_set_test_connect_timeout(test, sint);
|
||||||
|
gint = iperf_get_test_connect_timeout(test);
|
||||||
|
assert(sint == gint);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user