mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-10 10:26:47 +09:00
session: Reformat ssh_new()
Fixes T194
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 3f64fb3b3b)
This commit is contained in:
committed by
Andreas Schneider
parent
7851f216af
commit
71ff06d04a
@@ -56,7 +56,8 @@
|
||||
*
|
||||
* @returns A new ssh_session pointer, NULL on error.
|
||||
*/
|
||||
ssh_session ssh_new(void) {
|
||||
ssh_session ssh_new(void)
|
||||
{
|
||||
ssh_session session;
|
||||
char *id = NULL;
|
||||
int rc;
|
||||
@@ -81,7 +82,7 @@ ssh_session ssh_new(void) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
session->in_buffer=ssh_buffer_new();
|
||||
session->in_buffer = ssh_buffer_new();
|
||||
if (session->in_buffer == NULL) {
|
||||
goto err;
|
||||
}
|
||||
@@ -107,10 +108,14 @@ ssh_session ssh_new(void) {
|
||||
session->opts.StrictHostKeyChecking = 1;
|
||||
session->opts.port = 0;
|
||||
session->opts.fd = -1;
|
||||
session->opts.compressionlevel=7;
|
||||
session->opts.compressionlevel = 7;
|
||||
session->opts.nodelay = 0;
|
||||
session->opts.flags = SSH_OPT_FLAG_PASSWORD_AUTH | SSH_OPT_FLAG_PUBKEY_AUTH |
|
||||
SSH_OPT_FLAG_KBDINT_AUTH | SSH_OPT_FLAG_GSSAPI_AUTH;
|
||||
|
||||
session->opts.flags = SSH_OPT_FLAG_PASSWORD_AUTH |
|
||||
SSH_OPT_FLAG_PUBKEY_AUTH |
|
||||
SSH_OPT_FLAG_KBDINT_AUTH |
|
||||
SSH_OPT_FLAG_GSSAPI_AUTH;
|
||||
|
||||
session->opts.identity = ssh_list_new();
|
||||
if (session->opts.identity == NULL) {
|
||||
goto err;
|
||||
@@ -120,6 +125,7 @@ ssh_session ssh_new(void) {
|
||||
if (id == NULL) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
rc = ssh_list_append(session->opts.identity, id);
|
||||
if (rc == SSH_ERROR) {
|
||||
goto err;
|
||||
|
||||
Reference in New Issue
Block a user