mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
ssh_scp_request_get_{filename,permissions,size}
This commit is contained in:
@@ -487,6 +487,9 @@ LIBSSH_API int ssh_scp_pull_request(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_deny_request(ssh_scp scp, const char *reason);
|
||||
LIBSSH_API int ssh_scp_accept_request(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_read(ssh_scp scp, void *buffer, size_t size);
|
||||
LIBSSH_API const char *ssh_scp_request_get_filename(ssh_scp scp);
|
||||
LIBSSH_API const char *ssh_scp_request_get_permissions(ssh_scp scp);
|
||||
LIBSSH_API size_t ssh_scp_request_get_size(ssh_scp scp);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
24
libssh/scp.c
24
libssh/scp.c
@@ -459,3 +459,27 @@ int ssh_scp_read(ssh_scp scp, void *buffer, size_t size){
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/** Gets the name of the directory or file being
|
||||
* pushed from the other party
|
||||
* @returns file name. Should not be freed.
|
||||
*/
|
||||
const char *ssh_scp_request_get_filename(ssh_scp scp){
|
||||
return scp->request_name;
|
||||
}
|
||||
|
||||
/** Gets the permissions of the directory or file being
|
||||
* pushed from the other party
|
||||
* @returns Unix permission string, e.g "0644". Should not be freed.
|
||||
*/
|
||||
const char *ssh_scp_request_get_permissions(ssh_scp scp){
|
||||
return scp->request_mode;
|
||||
}
|
||||
|
||||
/** Gets the size of the file being pushed
|
||||
* from the other party
|
||||
* @returns Numeric size of the file being read.
|
||||
*/
|
||||
size_t ssh_scp_request_get_size(ssh_scp scp){
|
||||
return scp->filelen;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user