Free stream data. Delete file after opening for download.
This commit is contained in:
parent
ee20114c67
commit
efc7477ef5
@ -678,6 +678,7 @@ int rdp_guac_client_ack_handler(guac_client* client, guac_stream* stream,
|
|||||||
else if (bytes_read == 0) {
|
else if (bytes_read == 0) {
|
||||||
guac_protocol_send_end(client->socket, stream);
|
guac_protocol_send_end(client->socket, stream);
|
||||||
guac_client_free_stream(client, stream);
|
guac_client_free_stream(client, stream);
|
||||||
|
free(download);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Otherwise, fail stream */
|
/* Otherwise, fail stream */
|
||||||
@ -685,6 +686,7 @@ int rdp_guac_client_ack_handler(guac_client* client, guac_stream* stream,
|
|||||||
guac_client_log_error(client, "Error reading file for download");
|
guac_client_log_error(client, "Error reading file for download");
|
||||||
guac_protocol_send_end(client->socket, stream);
|
guac_protocol_send_end(client->socket, stream);
|
||||||
guac_client_free_stream(client, stream);
|
guac_client_free_stream(client, stream);
|
||||||
|
free(download);
|
||||||
}
|
}
|
||||||
|
|
||||||
guac_socket_flush(client->socket);
|
guac_socket_flush(client->socket);
|
||||||
|
@ -237,6 +237,7 @@ void guac_rdpdr_fs_process_close(guac_rdpdr_device* device,
|
|||||||
if (file_id >= 0) {
|
if (file_id >= 0) {
|
||||||
|
|
||||||
guac_rdp_download_status* status;
|
guac_rdp_download_status* status;
|
||||||
|
char* basename;
|
||||||
|
|
||||||
/* Associate stream with transfer status */
|
/* Associate stream with transfer status */
|
||||||
guac_stream* stream = guac_client_alloc_stream(client);
|
guac_stream* stream = guac_client_alloc_stream(client);
|
||||||
@ -244,8 +245,11 @@ void guac_rdpdr_fs_process_close(guac_rdpdr_device* device,
|
|||||||
status->file_id = file_id;
|
status->file_id = file_id;
|
||||||
status->offset = 0;
|
status->offset = 0;
|
||||||
|
|
||||||
|
/* Delete file after opened */
|
||||||
|
guac_rdp_fs_delete((guac_rdp_fs*) device->data, file_id);
|
||||||
|
|
||||||
/* Get basename from absolute path */
|
/* Get basename from absolute path */
|
||||||
char* basename = file->absolute_path;
|
basename = file->absolute_path;
|
||||||
do {
|
do {
|
||||||
|
|
||||||
c = file->absolute_path[i];
|
c = file->absolute_path[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user