sftp.c, sftp.h: Store the limits in the sftp_session

In the sftp_init() call, the limits are stored in the sftp_sesssion.
If the limits@openssh.com extension is supported the limits are retrieved
from the server, else libssh uses the default limits.

The sftp library functions that require the limits can access them using
the sftp session.

The library user can call sftp_limits() to get a copy of the limits
stored in the sftp session. Since the limits were already retrieved
from the server during sftp_init(), this sftp_limits() call requires
no communication with the server.

Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Eshan Kelkar
2023-12-07 11:39:36 +05:30
committed by Jakub Jelen
parent 5ea247df8e
commit 4f24fbd3a0
2 changed files with 112 additions and 2 deletions

View File

@@ -92,6 +92,7 @@ struct sftp_session_struct {
void **handles;
sftp_ext ext;
sftp_packet read_packet;
sftp_limits_t limits;
};
struct sftp_packet_struct {