mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
Improve sftp_reply_attr.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@624 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -276,13 +276,22 @@ int sftp_reply_handle(SFTP_CLIENT_MESSAGE *msg, STRING *handle){
|
||||
}
|
||||
|
||||
int sftp_reply_attr(SFTP_CLIENT_MESSAGE *msg, SFTP_ATTRIBUTES *attr) {
|
||||
BUFFER *out=buffer_new();
|
||||
int r;
|
||||
buffer_add_u32(out,msg->id);
|
||||
buffer_add_attributes(out,attr);
|
||||
r=sftp_packet_write(msg->sftp,SSH_FXP_ATTRS,out);
|
||||
BUFFER *out;
|
||||
|
||||
out = buffer_new();
|
||||
if (out == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (buffer_add_u32(out, msg->id) < 0 ||
|
||||
buffer_add_attributes(out, attr) < 0 ||
|
||||
sftp_packet_write(msg->sftp, SSH_FXP_ATTRS, out) < 0) {
|
||||
buffer_free(out);
|
||||
return r<0;
|
||||
return -1;
|
||||
}
|
||||
buffer_free(out);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sftp_reply_names_add(SFTP_CLIENT_MESSAGE *msg, char *file, char *longname,
|
||||
|
||||
Reference in New Issue
Block a user