summaryrefslogtreecommitdiffstats
path: root/server/reds.h
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2011-08-03 18:36:04 +0300
committerAlon Levy <alevy@redhat.com>2011-08-23 18:27:46 +0300
commitf84dfeb0aac4b6b49bc447a2140cbc7c2882de51 (patch)
tree67797cd53349553b101bf1f9c5ea4057b123bacb /server/reds.h
parent1db936e64cfe955a757d9d77302f104f68a58bfd (diff)
downloadspice-f84dfeb0aac4b6b49bc447a2140cbc7c2882de51.tar.gz
spice-f84dfeb0aac4b6b49bc447a2140cbc7c2882de51.tar.xz
spice-f84dfeb0aac4b6b49bc447a2140cbc7c2882de51.zip
server: registering RedChannel in reds, instead of Channel
Merging the functionality of reds::channel, into RedChannel. In addition, cleanup and fix disconnection code: before this patch, red_dispatcher_disconnect_display_client could have been called from the red_worker thread (and it must be called only from the io thread). RedChannel holds only connected channel clients. RedClient holds all the channel clients that were created till it is destroyed (and then it destroys them as well). Note: snd_channel still doesn't use red_channel, however it creates dummy channel and channel clients, in order to register itself in reds. server/red_channel.c: a channel is connected if it holds at least one channel client Previously I changed RedChannel to hold only connected channel clients and RedClient, to hold all the channel clients as long as it is not destroyed. usbredir: multichannel has not been tested, it just compiles.
Diffstat (limited to 'server/reds.h')
-rw-r--r--server/reds.h27
1 files changed, 3 insertions, 24 deletions
diff --git a/server/reds.h b/server/reds.h
index 6930fe6a..0bbda143 100644
--- a/server/reds.h
+++ b/server/reds.h
@@ -31,13 +31,10 @@
#include "common/marshaller.h"
#include "common/messages.h"
#include "spice.h"
+#include "red_channel.h"
#define SPICE_GNUC_VISIBLE __attribute__ ((visibility ("default")))
-typedef struct RedsStream RedsStream;
-typedef struct RedClient RedClient;
-typedef struct MainChannelClient MainChannelClient;
-
#if HAVE_SASL
typedef struct RedsSASL {
sasl_conn_t *conn;
@@ -88,22 +85,6 @@ struct RedsStream {
ssize_t (*writev)(RedsStream *s, const struct iovec *iov, int iovcnt);
};
-typedef struct Channel {
- struct Channel *next;
- uint32_t type;
- uint32_t id;
- int num_common_caps;
- uint32_t *common_caps;
- int num_caps;
- uint32_t *caps;
- void (*link)(struct Channel *, RedClient *client, RedsStream *stream,
- int migration, int num_common_caps,
- uint32_t *common_caps, int num_caps, uint32_t *caps);
- void (*shutdown)(struct Channel *);
- void (*migrate)(struct Channel *);
- void *data;
-} Channel;
-
struct QXLState {
QXLInterface *qif;
struct RedDispatcher *dispatcher;
@@ -114,8 +95,6 @@ struct SpiceNetWireState {
struct TunnelWorker *worker;
};
-void reds_channel_dispose(Channel *channel);
-
ssize_t reds_stream_read(RedsStream *s, void *buf, size_t nbyte);
ssize_t reds_stream_write(RedsStream *s, const void *buf, size_t nbyte);
ssize_t reds_stream_writev(RedsStream *s, const struct iovec *iov, int iovcnt);
@@ -127,8 +106,8 @@ void reds_update_mm_timer(uint32_t mm_time);
uint32_t reds_get_mm_time(void);
void reds_set_client_mouse_allowed(int is_client_mouse_allowed,
int x_res, int y_res);
-void reds_register_channel(Channel *channel);
-void reds_unregister_channel(Channel *channel);
+void reds_register_channel(RedChannel *channel);
+void reds_unregister_channel(RedChannel *channel);
int reds_get_mouse_mode(void); // used by inputs_channel
int reds_get_agent_mouse(void); // used by inputs_channel
int reds_has_vdagent(void); // used by inputs channel