Start download if file moved to Download folder.

This commit is contained in:
Michael Jumper 2013-12-17 22:47:00 -08:00
parent 88f9f883b4
commit 6479d0e8fa

View File

@ -162,7 +162,26 @@ void guac_rdpdr_fs_process_set_rename_info(guac_rdpdr_device* device,
GUAC_RDP_DEBUG(2, "[file_id=%i] destination_path=\"%s\"", file_id, destination_path); GUAC_RDP_DEBUG(2, "[file_id=%i] destination_path=\"%s\"", file_id, destination_path);
/* Perform rename */ /* If file moving to \Download folder, start stream, do not move */
if (strncmp(destination_path, "\\Download\\", 10) == 0) {
guac_rdp_fs_file* file;
/* Get file */
file = guac_rdp_fs_get_file((guac_rdp_fs*) device->data, file_id);
if (file == NULL)
return;
/* Initiate download, pretend move succeeded */
guac_rdpdr_start_download(device, file->absolute_path);
output_stream = guac_rdpdr_new_io_completion(device,
completion_id, STATUS_SUCCESS, 4);
}
/* Otherwise, rename as requested */
else {
result = guac_rdp_fs_rename((guac_rdp_fs*) device->data, file_id, result = guac_rdp_fs_rename((guac_rdp_fs*) device->data, file_id,
destination_path); destination_path);
if (result < 0) if (result < 0)
@ -172,6 +191,8 @@ void guac_rdpdr_fs_process_set_rename_info(guac_rdpdr_device* device,
output_stream = guac_rdpdr_new_io_completion(device, output_stream = guac_rdpdr_new_io_completion(device,
completion_id, STATUS_SUCCESS, 4); completion_id, STATUS_SUCCESS, 4);
}
Stream_Write_UINT32(output_stream, length); Stream_Write_UINT32(output_stream, length);
svc_plugin_send((rdpSvcPlugin*) device->rdpdr, output_stream); svc_plugin_send((rdpSvcPlugin*) device->rdpdr, output_stream);