1
1

feat(api): Provide API access to --commit-timeout. (#1001)

Fixes #1000.  Part of #595.
Этот коммит содержится в:
Bruce A. Mah 2020-05-19 07:37:18 -07:00 коммит произвёл GitHub
родитель 2609dd7123
Коммит de848cffad
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 30 добавлений и 2 удалений

Просмотреть файл

@ -344,6 +344,12 @@ iperf_get_test_no_delay(struct iperf_test *ipt)
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 *************/
void
@ -627,6 +633,13 @@ iperf_set_test_no_delay(struct iperf_test* ipt, int 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 ***********************/
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
* to receipt of any required approvals from the U.S. Dept. of
* 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_iperf_version(void);
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. */
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);
#endif // HAVE_SSL
void iperf_set_test_connect_timeout(struct iperf_test *ipt, int ct);
/**
* exchange_parameters - handles the param_Exchange part for client
*

Просмотреть файл

@ -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
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
@ -45,9 +45,21 @@ int
main(int argc, char **argv)
{
const char *ver;
struct iperf_test *test;
int sint, gint;
ver = iperf_get_iperf_version();
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;
}