mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
config: Get rid of the dynamic seen array
* This makes the array constant in the session structure, avoiding allocations and frees while parsing the file * It also drops passing the seen array to all the functions, because it is already part of the passed session * The test cases are adjusted to match these changes Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
8f887e82c7
commit
21e2522360
@@ -92,8 +92,6 @@ static void torture_client_config_system(void **state)
|
||||
struct torture_state *s = *state;
|
||||
int ret = 0;
|
||||
|
||||
assert_true(s->ssh.session->opts.options_seen == NULL);
|
||||
|
||||
/* The first tests assumes there is system-wide configuration file
|
||||
* setting Ciphers to some non-default value. We do not have any control
|
||||
* of that in this test case.
|
||||
@@ -121,8 +119,6 @@ static void torture_client_config_emulate(void **state)
|
||||
char *filename = NULL;
|
||||
int ret = 0;
|
||||
|
||||
assert_true(s->ssh.session->opts.options_seen == NULL);
|
||||
|
||||
/* The first tests assumes there is system-wide configuration file
|
||||
* setting Ciphers to some non-default value. We do not have any control
|
||||
* of that in this test case
|
||||
@@ -151,8 +147,6 @@ static void torture_client_config_autoparse(void **state)
|
||||
struct torture_state *s = *state;
|
||||
int ret = 0;
|
||||
|
||||
assert_true(s->ssh.session->opts.options_seen == NULL);
|
||||
|
||||
ret = ssh_connect(s->ssh.session);
|
||||
assert_ssh_return_code(s->ssh.session, ret);
|
||||
|
||||
@@ -169,8 +163,6 @@ static void torture_client_config_suppress(void **state)
|
||||
bool b = false;
|
||||
int ret = 0;
|
||||
|
||||
assert_true(s->ssh.session->opts.options_seen == NULL);
|
||||
|
||||
ret = ssh_options_set(s->ssh.session, SSH_OPTIONS_PROCESS_CONFIG, &b);
|
||||
assert_ssh_return_code(s->ssh.session, ret);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user