Commit Graph

579 Commits

Author SHA1 Message Date
Frediano Ziglio
a0c184e89b stream-device: Add device to handle streaming
Add a stub device in guest.
The aim of this device is to make it possible for the guest to send a
stream through a DisplayChannel (in the sense of protocol channel).
This stub allows the guest to send some data and you can see some debug
lines of data arrived on host logs.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-10-16 19:59:14 +01:00
Frediano Ziglio
e216c4b4bd Notify client of the creation of new channels dynamically
This allows the server to add channels after the client is connected.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-10-16 19:58:45 +01:00
Frediano Ziglio
343ac9f78d reds: Remove leak allocating migration state
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-10-13 17:10:53 +01:00
Frediano Ziglio
13fffbf885 reds: Use GLib memory functions for ChannelSecurityOptions
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-10-11 12:52:17 +01:00
Frediano Ziglio
6e2e98383f reds: Use GLib memory functions for link message
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-10-11 12:52:17 +01:00
Frediano Ziglio
68d5f90774 Use GLib memory functions for SpiceChannelEventInfo
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-10-11 12:52:17 +01:00
Frediano Ziglio
78f1381f14 gl: fix client mouse mode
Since 2.8, QEMU no longer creates QXL primary surfaces when using GL.
This change broke client-side mouse mode, because Spice server relies on
having a primary surface.

When GL is enabled, use GL scanout informations.
Mouse mode is always client when GL surfaces are used.

This patch and most of the message are based on a patch from
Marc-André Lureau, just moving responsibility from reds to RedQxl.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Christophe de Dinechin <dinechin@redhat.com>
2017-10-04 10:57:39 +01:00
Frediano Ziglio
5ccad96671 Use GLib memory functions for RedsMigSpice::cert_subject
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-09-19 16:17:11 +01:00
Frediano Ziglio
b4e05a0398 reds: Use GLib memory functions for RedServerConfig
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-09-19 16:17:11 +01:00
Frediano Ziglio
f6af788540 reds: Use GLib memory functions for RedServerConfig::mig_spice
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-09-19 16:17:11 +01:00
Frediano Ziglio
5c4df2f6c3 Use GLib memory functions for RedsMigSpice::host
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-09-19 16:17:11 +01:00
Frediano Ziglio
30205766b6 reds: Use GLib memory functions for migration data
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-09-19 16:17:11 +01:00
Frediano Ziglio
e1a8571cea reds: Use GLib memory functions for link
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-09-19 16:17:11 +01:00
Frediano Ziglio
7922e8c78e reds: Start using GLib memory functions
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-09-19 16:17:11 +01:00
Frediano Ziglio
a99043771a Start using GLib memory allocation
Start reducing the usage of spice_new*/spice_malloc allocations.
They were designed in a similar way to GLib ones.
Now that we use GLib make sense to remove them.
However the versions we support for GLib can use different memory
allocators so we have to match g_free with GLib allocations
and spice_* ones (which uses always malloc allocator) with free().
This patch remove some easy ones.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-09-19 16:17:10 +01:00
Frediano Ziglio
2e06a6e940 reds: Fix leaks if reds_init_client_ssl_connection fails
If a client is unable to complete the TLS handshake phase
reds_init_client_ssl_connection leaked some memory as the stream is not
correctly freed.
This also causes the stream to send the SPICE_CHANNEL_EVENT_DISCONNECTED
event. Otherwise only SPICE_CHANNEL_EVENT_CONNECTED was sent.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-09-12 11:58:40 +01:00
Frediano Ziglio
3a47f4e289 red-qxl: Unify red_qxl_use_client_monitors_config and red_qxl_client_monitors_config
These 2 functions were doing the same stuff, calling
client_monitors_config callback in QXLInterface.
The only difference was that red_qxl_use_client_monitors_config
used a NULL value.
Added the check for proper version, QXLInstance before 3.3
did not have this callback.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-09-07 16:13:49 +01:00
Frediano Ziglio
dd871c01a8 Avoid using global variable for channel IDs
This patch allocates VMC IDs by finding the first ID not used
instead of using a global variable and incrementing the value
for each channel created.
This solves some potential issues:
- remove the global state potentially making possible
  to use multiple SpiceServer on the same process;
- don't potentially overflow the variable. This can happen if
  channels are allocated/deallocated multiple times
  (currently not done by Qemu).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-09-02 08:20:56 +01:00
Frediano Ziglio
dcc9c18759 reds: Inline very simple function
reds_get_n_clients is a single line and is used only by
spice_server_get_num_clients.
The 2 functions have very similar names so inlining
reds_get_n_clients does not make code less readable.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-08-25 13:14:34 +01:00
Frediano Ziglio
3a5007d18f red-channel: unregister channel in red_channel_destroy
Mostly of red_channel_destroy calls were preceded by
a call to unregister the channel.
The only exception was the main channel as this channel is
always present and its initialisation is a bit different.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-08-23 22:19:07 +01:00
Frediano Ziglio
1026a89b78 reds: use SpiceMouseMode for RedsState::mouse_mode
Make easier to understant the value to use in the code.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-08-23 22:16:05 +01:00
Frediano Ziglio
e3bff1eea4 Remove iterator from list iteration macros
Avoid to have to declare iterator and pass as an argument.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2017-08-21 12:54:47 +01:00
Uri Lublin
8e593b55cf init ssl connection: return quickly if link is null
Under error: 'link' fields are being accessed, so it's
wrong to goto error with link == NULL.

Instead, return immediately.

Found by coverity.

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-07-19 15:56:20 +03:00
Frediano Ziglio
fbbcdad773 reds: Avoid buffer overflows handling monitor configuration
It was also possible for a malicious client to set
VDAgentMonitorsConfig::num_of_monitors to a number larger
than the actual size of VDAgentMOnitorsConfig::monitors.
This would lead to buffer overflows, which could allow the guest to
read part of the host memory. This might cause write overflows in the
host as well, but controlling the content of such buffers seems
complicated.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2017-07-11 10:40:27 +02:00
Frediano Ziglio
571cec91e7 reds: Avoid integer overflows handling monitor configuration
Avoid VDAgentMessage::size integer overflows.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2017-07-11 10:40:27 +02:00
Frediano Ziglio
111ab38611 reds: Disconnect when receiving overly big ClientMonitorsConfig
Total message size received from the client was unlimited. There is
a 2kiB size check on individual agent messages, but the MonitorsConfig
message can be split in multiple chunks, and the size of the
non-chunked MonitorsConfig message was never checked. This could easily
lead to memory exhaustion on the host.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2017-07-11 10:40:27 +02:00
Frediano Ziglio
a1387f036e log: Do not print function name twice during logging
spice_error/spice_warning already print location information
so don't print them twice.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongmsa <jjongsma@redhat.com>
2017-06-18 09:53:27 +01:00
Christophe Fergeau
429958f7d4 reds: Free client_monitors_config in spice_server_destroy()
This was not done until now, and it's only going to be needed if we receive
a partial ClientMonitorsConfig message.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-06-15 18:26:29 +02:00
Christophe Fergeau
edf90ba124 reds: Remove redundant __func in debug log
The function name is always prepended by the spice_log macro, so we
don't need to explicitly add it in debug messages.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-06-15 18:26:29 +02:00
Christophe Fergeau
2b08ba3d51 reds: Replace RedsClientMonitorsConfig with SpiceBuffer
RedsClientMonitorsConfig duplicates what SpiceBuffer does,
so using we can replace it with SpiceBuffer and make
reds_on_main_agent_monitors_config() simpler.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-06-15 18:26:29 +02:00
Christophe Fergeau
1569d429b7 Remove use of spice_debug(NULL)
This is causing issues with potential improvements to the logging
system, and I've always found this usage a bit odd anyway.
Using spice_debug(""); was not possible as this triggers
-Wformat-zero-length warnings from our use of -Wall.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-06-15 16:40:25 +01:00
Pavel Grunt
366b5b96c2 reds: Adjust agent capabilites to disabled features
File transfer and Copy & Paste can be disabled on the server even when
they're supported by the guest agent. Tell it the client by adjusting
the agent capabilities.

Related: rhbz#1373725

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-06-06 17:53:42 +01:00
Pavel Grunt
5dc55aa70d reds: Constantify agent message parameter
Make clear that the function is not changing it

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-06-02 11:20:45 +02:00
Frediano Ziglio
ed2e9d51f8 reds: Remove only assigned 'mcc' field
This field was never actually used, only changed.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-05-18 16:30:08 +01:00
Pavel Grunt
073be0ea6d Add "fall through" comments where necessary
Make gcc 7.0.1 happy

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-05-16 13:42:51 +01:00
Jonathon Jongsma
332ad52143 Change playback_compression to bool type
This is a setting for determining whether to compress the audio playback
channel or not. It is variously typed as int or uint32_t. Convert it to
a 'bool' to make it more clear that it is a true/false value rather than
an enumeration or something like that.
2017-04-07 15:08:43 -05:00
Christophe Fergeau
5ca3d6ca50 net: Introduce red_socket_set_keepalive() helper
This allows to move some low-level code out of reds.c

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-31 12:22:52 +02:00
Christophe Fergeau
b85ca4b8a9 net: Introduce red_socket_set_non_blocking() helper
This allows to move some low-level code out of reds.c

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-31 12:22:52 +02:00
Christophe Fergeau
ecf05ed6be reds-stream: Introduce reds_stream_set_no_delay() helper
The code to enable/disable on a TCP socket is duplicated in multiple
places in the code base, this commit replaces this duplicated code with
a helper in RedsStream.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-31 12:22:36 +02:00
Frediano Ziglio
5d046d9b2d red-channel: Initialize statistic node correctly
Doing a memset(0) on a SpiceStatNode does not create an empty/unattached
node, but instead creates a node '0'. This node could be non-existing,
or totally unrelated.
This patch creates a default '0' node as soon as the file is created.
This will make the behaviour of 0-filled nodes more in line with what
one would expect.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-31 11:02:02 +01:00
Frediano Ziglio
3377feef5a Initialize earlier GLib type system if necessary
Before GLib 2.36 you should call g_type_init before attempting
any GLib type usage.
As constructor function are called before even main we need
to call g_type_init much before do_spice_init.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-30 18:05:30 +01:00
Christophe Fergeau
4b1c95beee Add missing chainups to parent class
A few dispose/finalize implementations were not chaining up to their
parent classes, causing memory leaks.

This fixes leaks like the following:

==16240== Memcheck, a memory error detector
==16240== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==16240== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==16240== Command: ./test-leaks
==16240==
==16240==
==16240== HEAP SUMMARY:
==16240==     in use at exit: 245,490 bytes in 3,638 blocks
==16240==   total heap usage: 5,418 allocs, 1,780 frees, 17,676,968 bytes allocated
==16240==
==16240== 16 bytes in 1 blocks are definitely lost in loss record 203 of 771
==16240==    at 0x4C2DADE: malloc (vg_replace_malloc.c:298)
==16240==    by 0x4C2FC91: realloc (vg_replace_malloc.c:785)
==16240==    by 0x52864E: dispatcher_register_handler (dispatcher.c:374)
==16240==    by 0x5293E0: main_dispatcher_constructed (main-dispatcher.c:315)
==16240==    by 0x7F873DB: g_object_new_internal (gobject.c:1823)
==16240==    by 0x7F87EE4: g_object_new_valist (gobject.c:2042)
==16240==    by 0x7F86E90: g_object_new (gobject.c:1626)
==16240==    by 0x5292A5: main_dispatcher_new (main-dispatcher.c:295)
==16240==    by 0x429A0A: do_spice_init (reds.c:3416)
==16240==    by 0x42A3F5: spice_server_init (reds.c:3663)
==16240==    by 0x4095B1: server_leaks (test-leaks.c:45)
==16240==    by 0x844C60A: test_case_run (gtestutils.c:2161)
==16240==    by 0x844C9CA: g_test_run_suite_internal (gtestutils.c:2244)
==16240==    by 0x844CA73: g_test_run_suite_internal (gtestutils.c:2256)
==16240==    by 0x844CC8A: g_test_run_suite (gtestutils.c:2332)
==16240==    by 0x844B92C: g_test_run (gtestutils.c:1599)
==16240==    by 0x409A0B: main (test-leaks.c:126)
==16240==
==16240== 16 bytes in 1 blocks are definitely lost in loss record 204 of 771
==16240==    at 0x4C2DADE: malloc (vg_replace_malloc.c:298)
==16240==    by 0x4C2FC91: realloc (vg_replace_malloc.c:785)
==16240==    by 0x52864E: dispatcher_register_handler (dispatcher.c:374)
==16240==    by 0x5293E0: main_dispatcher_constructed (main-dispatcher.c:315)
==16240==    by 0x7F873DB: g_object_new_internal (gobject.c:1823)
==16240==    by 0x7F87EE4: g_object_new_valist (gobject.c:2042)
==16240==    by 0x7F86E90: g_object_new (gobject.c:1626)
==16240==    by 0x5292A5: main_dispatcher_new (main-dispatcher.c:295)
==16240==    by 0x429A0A: do_spice_init (reds.c:3416)
==16240==    by 0x42A3F5: spice_server_init (reds.c:3663)
==16240==    by 0x40BFD4: test_new (test-display-base.c:902)
==16240==    by 0x40979D: vmc_leaks (test-leaks.c:92)
==16240==    by 0x844C60A: test_case_run (gtestutils.c:2161)
==16240==    by 0x844C9CA: g_test_run_suite_internal (gtestutils.c:2244)
==16240==    by 0x844CA73: g_test_run_suite_internal (gtestutils.c:2256)
==16240==    by 0x844CC8A: g_test_run_suite (gtestutils.c:2332)
==16240==    by 0x844B92C: g_test_run (gtestutils.c:1599)
==16240==    by 0x409A0B: main (test-leaks.c:126)
==16240==
==16240== 96 bytes in 1 blocks are definitely lost in loss record 638 of 771
==16240==    at 0x4C2FA50: calloc (vg_replace_malloc.c:711)
==16240==    by 0x8427D3C: g_malloc0 (gmem.c:124)
==16240==    by 0x842801F: g_malloc0_n (gmem.c:355)
==16240==    by 0x527B44: dispatcher_constructed (dispatcher.c:141)
==16240==    by 0x529321: main_dispatcher_constructed (main-dispatcher.c:307)
==16240==    by 0x7F873DB: g_object_new_internal (gobject.c:1823)
==16240==    by 0x7F87EE4: g_object_new_valist (gobject.c:2042)
==16240==    by 0x7F86E90: g_object_new (gobject.c:1626)
==16240==    by 0x5292A5: main_dispatcher_new (main-dispatcher.c:295)
==16240==    by 0x429A0A: do_spice_init (reds.c:3416)
==16240==    by 0x42A3F5: spice_server_init (reds.c:3663)
==16240==    by 0x4095B1: server_leaks (test-leaks.c:45)
==16240==    by 0x844C60A: test_case_run (gtestutils.c:2161)
==16240==    by 0x844C9CA: g_test_run_suite_internal (gtestutils.c:2244)
==16240==    by 0x844CA73: g_test_run_suite_internal (gtestutils.c:2256)
==16240==    by 0x844CC8A: g_test_run_suite (gtestutils.c:2332)
==16240==    by 0x844B92C: g_test_run (gtestutils.c:1599)
==16240==    by 0x409A0B: main (test-leaks.c:126)
==16240==
==16240== 96 bytes in 1 blocks are definitely lost in loss record 639 of 771
==16240==    at 0x4C2FA50: calloc (vg_replace_malloc.c:711)
==16240==    by 0x8427D3C: g_malloc0 (gmem.c:124)
==16240==    by 0x842801F: g_malloc0_n (gmem.c:355)
==16240==    by 0x527B44: dispatcher_constructed (dispatcher.c:141)
==16240==    by 0x529321: main_dispatcher_constructed (main-dispatcher.c:307)
==16240==    by 0x7F873DB: g_object_new_internal (gobject.c:1823)
==16240==    by 0x7F87EE4: g_object_new_valist (gobject.c:2042)
==16240==    by 0x7F86E90: g_object_new (gobject.c:1626)
==16240==    by 0x5292A5: main_dispatcher_new (main-dispatcher.c:295)
==16240==    by 0x429A0A: do_spice_init (reds.c:3416)
==16240==    by 0x42A3F5: spice_server_init (reds.c:3663)
==16240==    by 0x40BFD4: test_new (test-display-base.c:902)
==16240==    by 0x40979D: vmc_leaks (test-leaks.c:92)
==16240==    by 0x844C60A: test_case_run (gtestutils.c:2161)
==16240==    by 0x844C9CA: g_test_run_suite_internal (gtestutils.c:2244)
==16240==    by 0x844CA73: g_test_run_suite_internal (gtestutils.c:2256)
==16240==    by 0x844CC8A: g_test_run_suite (gtestutils.c:2332)
==16240==    by 0x844B92C: g_test_run (gtestutils.c:1599)
==16240==    by 0x409A0B: main (test-leaks.c:126)
==16240==
==16240== LEAK SUMMARY:
==16240==    definitely lost: 224 bytes in 4 blocks
==16240==    indirectly lost: 0 bytes in 0 blocks
==16240==      possibly lost: 0 bytes in 0 blocks
==16240==    still reachable: 207,718 bytes in 3,312 blocks
==16240==                       of which reachable via heuristic:
==16240==                         newarray           : 1,536 bytes in 16 blocks
==16240==         suppressed: 34,548 bytes in 302 blocks
==16240== Reachable blocks (those to which a pointer was found) are not shown.
==16240== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==16240==
==16240== For counts of detected and suppressed errors, rerun with: -v
==16240== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 20 from 20)
FAIL test-leaks (exit status: 1)

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-14 09:19:49 +00:00
Christophe Fergeau
6377b72d44 Use bool rather than int return values when appropriate
This commit changes all functions returning TRUE/FALSE from having an
'int' return value to 'bool'.
This way it's obvious that such a function is not going to return
anything else than TRUE or FALSE.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-09 18:39:29 +01:00
Christophe Fergeau
972cbdcfd9 Remove stdbool.h include from .c files
It's already included in red-common.h

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-09 18:39:13 +01:00
Frediano Ziglio
9bcfba3c68 reds: Change if style
The nested if statements could be confusing, no needs for them.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-03-08 10:49:28 +00:00
Frediano Ziglio
fa36ab45b3 reds: Send link replies with less chunks
Send header and reply together.
This potentially save up to 160 bytes on the network which
is a considerable amount considering that the message is
about 50 bytes.
This as sending multiple chunks you can have different framing,
specifically:
- if you use TLS every chunk get encrypted separately
  (reds-stream, currently usually 29 bytes for every chunks);
- tcp settings and no delay on socket. More likely with fast
  connections or better network cards. The tcp framing is
  usually about 80 bytes;
- additional tcp acknowledge (usually 64 bytes).
So 80 + 29 + 64 = 173 bytes.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-07 15:08:34 +00:00
Frediano Ziglio
541d54af42 reds: Do not leak SSL context
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-06 17:01:08 +00:00
Frediano Ziglio
0bbfe733b8 record: Allocate recording file globally from reds.c
Allows to use recording function for multiple purposes.
This will allow to register multiple screen VM or recording
additional stuff like sound.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-03-02 16:14:10 +00:00
Frediano Ziglio
afc4171c98 red-channel: Use RedChannelCapabilities directly to pass capabilities
For each channel there are two set of capabilities, one
for the common ones and one for the specific ones.
A single set were almost always passed using 2 arguments,
a number of elements and an array but then before using
these were converted to a GArray.
Use a single structure (already available) to pass all
channel capabilites using a single argument.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-03-02 15:34:58 +00:00
Christophe Fergeau
4633ea6d87 Use spice_debug rather than spice_info in library code
Using spice_info() gets in the way of tests using
g_test_expect_message() as all the messages emitted using
a non-debug log level must be listed as expected, otherwise we get a
critical about an expected message not having been logged.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-01 18:01:25 +01:00