GUAC-1172: Associate guac_object with RDP filesystem.
This commit is contained in:
parent
637e5e95f7
commit
fef6cd212b
@ -30,6 +30,8 @@
|
||||
|
||||
#include <freerdp/utils/svc_plugin.h>
|
||||
#include <guacamole/client.h>
|
||||
#include <guacamole/protocol.h>
|
||||
#include <guacamole/socket.h>
|
||||
|
||||
#ifdef ENABLE_WINPR
|
||||
#include <winpr/stream.h>
|
||||
@ -152,5 +154,10 @@ void guac_rdpdr_register_fs(guac_rdpdrPlugin* rdpdr) {
|
||||
/* Init data */
|
||||
device->data = data->filesystem;
|
||||
|
||||
/* Announce filesystem to client */
|
||||
guac_protocol_send_filesystem(rdpdr->client->socket,
|
||||
data->filesystem->object, "Shared Drive");
|
||||
guac_socket_flush(rdpdr->client->socket);
|
||||
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include <sys/statvfs.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <guacamole/object.h>
|
||||
#include <guacamole/pool.h>
|
||||
|
||||
guac_rdp_fs* guac_rdp_fs_alloc(guac_client* client, const char* drive_path) {
|
||||
@ -43,6 +44,8 @@ guac_rdp_fs* guac_rdp_fs_alloc(guac_client* client, const char* drive_path) {
|
||||
guac_rdp_fs* fs = malloc(sizeof(guac_rdp_fs));
|
||||
|
||||
fs->client = client;
|
||||
fs->object = guac_client_alloc_object(client);
|
||||
|
||||
fs->drive_path = strdup(drive_path);
|
||||
fs->file_id_pool = guac_pool_alloc(0);
|
||||
fs->open_files = 0;
|
||||
@ -52,6 +55,7 @@ guac_rdp_fs* guac_rdp_fs_alloc(guac_client* client, const char* drive_path) {
|
||||
}
|
||||
|
||||
void guac_rdp_fs_free(guac_rdp_fs* fs) {
|
||||
guac_client_free_object(fs->client, fs->object);
|
||||
guac_pool_free(fs->file_id_pool);
|
||||
free(fs->drive_path);
|
||||
free(fs);
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <guacamole/client.h>
|
||||
#include <guacamole/object.h>
|
||||
#include <guacamole/pool.h>
|
||||
|
||||
#include <dirent.h>
|
||||
@ -272,6 +273,11 @@ typedef struct guac_rdp_fs {
|
||||
*/
|
||||
guac_client* client;
|
||||
|
||||
/**
|
||||
* The underlying filesystem object.
|
||||
*/
|
||||
guac_object* object;
|
||||
|
||||
/**
|
||||
* The root of the filesystem.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user