summaryrefslogtreecommitdiff
path: root/server/red-channel.c
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2016-02-02 12:51:17 +0000
committerFrediano Ziglio <fziglio@redhat.com>2016-02-02 12:52:10 +0000
commit8b14dc113c464dd35216dc2d2b295d4555bdaaa5 (patch)
treeb98949035862be453c5615068bf41ba787a34aeb /server/red-channel.c
parentb206efb30bf41cb2e071f75cee87901cad1c83b7 (diff)
red-channel: send marshaller message fd
Send the fd associated to the last message sent. Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
Diffstat (limited to 'server/red-channel.c')
-rw-r--r--server/red-channel.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/red-channel.c b/server/red-channel.c
index fd414933..33d4158f 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -608,8 +608,22 @@ static inline void red_channel_client_release_sent_item(RedChannelClient *rcc)
static void red_channel_peer_on_out_msg_done(void *opaque)
{
RedChannelClient *rcc = (RedChannelClient *)opaque;
+ int fd;
rcc->send_data.size = 0;
+
+ if (spice_marshaller_get_fd(rcc->send_data.marshaller, &fd)) {
+ if (reds_stream_send_msgfd(rcc->stream, fd) < 0) {
+ perror("sendfd");
+ red_channel_client_disconnect(rcc);
+ if (fd != -1)
+ close(fd);
+ return;
+ }
+ if (fd != -1)
+ close(fd);
+ }
+
red_channel_client_release_sent_item(rcc);
if (rcc->send_data.blocked) {
rcc->send_data.blocked = FALSE;