summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* iopipe: fix leak of streamsMarc-André Lureau2015-05-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | g_simple_io_stream_new() do not steal references from us, unref the streams to avoid the leaks. Leak found by Victor Toso. ==30787== 2,808 (648 direct, 2,160 indirect) bytes in 9 blocks are definitely lost in loss record 479 of 482 ==30787== at 0x93AEBFD: g_type_create_instance (gtype.c:1849) ==30787== by 0x939128A: g_object_new_internal (gobject.c:1774) ==30787== by 0x9392AA0: g_object_newv (gobject.c:1921) ==30787== by 0x939338B: g_object_new (gobject.c:1614) ==30787== by 0x403B30: make_gio_pipe (giopipe.c:441) ==30787== by 0x403C8E: spice_make_pipe (giopipe.c:465) ==30787== by 0x4029B5: fixture_set_up (pipe.c:42) ==30787== by 0x9844EC8: test_case_run (gtestutils.c:2123) ==30787== by 0x9844EC8: g_test_run_suite_internal (gtestutils.c:2185) ==30787== by 0x984509A: g_test_run_suite_internal (gtestutils.c:2196) ==30787== by 0x98453FA: g_test_run_suite (gtestutils.c:2249) ==30787== by 0x9845430: g_test_run (gtestutils.c:1553) ==30787== by 0x402012: main (pipe.c:312)
* spicy: remove useless signal handlersMarc-André Lureau2015-05-121-45/+0
| | | | | | | | There is no strong reason to have signal handlers in spicy (a test tool). Clean quit can be achieved through the File/Quit menu. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1197175
* spice-gtk: Fixed build when using audio gstreamerLukas Venhoda2015-05-121-1/+1
| | | | | | | | Commit No. 63bf00275769928850113b4df205df08d6303b45 changed number of arguments of function playback_stop(), and didn't change call of this function on line 628. This would break building when using --with-audio=gstreamer
* webdav: check g_output_stream_write_all() return valueMarc-André Lureau2015-05-071-3/+4
| | | | | Check g_output_stream_write_all() return value to silence a coverity CHECKED_RETURN warning
* usb: channel-new handler to be after default handlersMarc-André Lureau2015-05-071-2/+1
| | | | | | | | | | | | | | | | Client usually connect to channel-new to connect their handlers, such as open-fd. The usbmanager channel-new handler will call channel_connect() on usbredir channels, which may call open-fd. However, open-fd can be emitted before the client had a chance to connect their handlers (from the channel-new callback). Connecting after the default handler solves this case. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=748665
* session: do not attempt to open_host if session changedMarc-André Lureau2015-05-071-2/+5
| | | | | Since channel can become session-less, let's check they still have the expected session when running the open-host idle.
* audio: stop playback on channel destroyedMarc-André Lureau2015-05-072-0/+4
| | | | Ensure playback is stopped when the channel is destroyed.
* audio: use swapped channel handler for stopMarc-André Lureau2015-05-072-7/+5
| | | | We are going to reuse playback_stop() in following commit.
* record: do not crash after record is stoppedMarc-André Lureau2015-05-071-3/+7
| | | | | | | | | | | | | | | | | | | | | | If spice_record_send_data() after a reset, last_frame is NULL and memcpy will crash. Check if the recording was started if last_frame != NULL instead. Program received signal SIGSEGV, Segmentation fault. __memcpy_avx_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S:204 204 vmovdqa %ymm0, (%rdi) (gdb) bt #0 __memcpy_avx_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S:204 #1 0x00007ffff44f57b5 in spice_record_send_data (channel=0x1228640, data=0x7fff9ad0f000, bytes=960, time=0) at channel-record.c:349 #2 0x00007ffff45162f0 in stream_read_callback (s=0xad8c00, length=960, data=<optimized out>) at spice-pulse.c:485 #3 0x00007ffff2ea0c76 in pstream_memblock_callback (p=<optimized out>, channel=<optimized out>, offset=0, seek=PA_SEEK_RELATIVE, chunk=0x7fffffffcf70, userdata=0x11e71c0) at pulse/context.c:411 #4 0x00007fffe8da8b4f in do_read (p=p@entry=0x123a050, re=re@entry=0x123a1d0) at pulsecore/pstream.c:906 #5 0x00007fffe8daae87 in do_pstream_read_write (p=0x123a050) at pulsecore/pstream.c:193 #6 0x00007ffff30e1bea in dispatch_func (source=0x1111e50, callback=<optimized out>, userdata=<optimized out>) at pulse/glib-mainloop.c:584 #7 0x00007fffed76b93b in g_main_dispatch (context=0x816ea0) at gmain.c:3122 Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1215343
* playback: do not set mm time when session-lessMarc-André Lureau2015-05-071-2/+8
| | | | | | Channels do not hold a strong reference on the session (because session can be recycled after disconnect), do not print a warning if the channel is session-less when updating the delay.
* audio: emit stop when the channels are resetMarc-André Lureau2015-05-072-0/+5
| | | | | | | | Ensure a hint is given to the client that the channel is reset. Unfortunately, since the handle may be asynchronous due to coroutine, the channel functions should be tolerant to a playback/record calls functions when the channel is stopped.
* audio: channel-new handler to be after default handlersMarc-André Lureau2015-05-071-1/+1
| | | | | | | | | | | | | | | | Client usually connect to channel-new to connect their handlers, such as open-fd. The audio channel-new handler will call channel_connect() on audio channels, which may call open-fd. However, open-fd can be emitted before the client had a chance to connect their handlers (from the channel-new callback). Connecting after the default handler solves this case. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=747649
* spice-pulse: compatibility with old pulse versionVictor Toso2015-04-301-0/+14
| | | | | | | The commit 37ba949716ebf441110330 breaks compatibility with old versions of libpulse as the volume and mute data in pa_source_output_info were available only from version 1.0.0 onwards. Using other API function for this which does not relay on audio per stream.
* spice-pulse: GSimpleAsyncResult compatibilityVictor Toso2015-04-301-0/+11
| | | | | Avoid breaking build with glib older then 2.32 which is when g_simple_async_result_set_check_cancellable was introduced.
* glib-compat: add G_SOURCE_REMOVE G_SOURCE_CONTINUEVictor Toso2015-04-301-0/+4
|
* session: Get the lock modifiers from GdkKeymapFabiano Fidêncio2015-04-271-0/+16
| | | | | | | | | A cleaner way to get the lock modifiers, without depend on the platform/backend used (as X or Wayland), is get them through GdkKeymap (and its _get{caps,num,scroll}_lock_state() functions). Unfortunately, get_scroll_lock_state() will only be present for Gtk+ 3.18.0 and when it becomes the minimal required version we can easily drop the old code.
* agent: sync guest audio with client valuesVictor Toso2015-04-242-1/+133
| | | | | | | Functions to sync volume and mute value when necessary. In this patch, only one sync is allowed after agent connect. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1012868
* audio: spice-gstaudio implements async volume-infoVictor Toso2015-04-241-1/+194
| | | | | | Gstaudio rely on sink/src elements to get the volume/mute. (e.g. pulsesink and pulsesrc, the values are updated by PulseAudio itself when requested)
* audio: spice-pulse implement async volume-infoVictor Toso2015-04-241-9/+480
| | | | | | | | | | | In case of volume-sync between client and guest, we request volume-info from the availables streams and if the stream is not available we rely on ext-stream-restore. By using ext-stream-restore we can get the last stream data of the application that is stored by PulseAudio. Related: https://bugzilla.redhat.com/show_bug.cgi?id=1012868
* audio: spice-audio with get mute and volumeVictor Toso2015-04-243-2/+76
| | | | | | | Async functions to be implemented by spice-gstaudio and spice-pulse to get the updated volume and mute values for playback and record stream. Related: https://bugzilla.redhat.com/show_bug.cgi?id=1012868
* Update spice-common submoduleVictor Toso2015-04-241-0/+0
| | | | This includes volume synchronization protocol;
* spice-widget: Do not invalidate cursor when display is not readyPavel Grunt2015-04-241-0/+3
| | | | | | | spice_display_get_scaling() gives wrong x, y coordinates and scaling when the display is not ready. The wrong values cause runtime warnings when disabling a virt-viewer's window: Gtk-CRITICAL **: gtk_widget_queue_draw_area: assertion 'width >= 0' failed
* Fix GSocketAddress leak in proxy_lookup_ready()Christophe Fergeau2015-04-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | g_proxy_address_new() returns a new GProxyAddress, so we must unref it when no longer needed. This fixes: ==6481== 234 (48 direct, 186 indirect) bytes in 1 blocks are definitely lost in loss record 10,062 of 10, ==6481== at 0x31FF230A58: g_type_create_instance (gtype.c:1849) ==6481== by 0x31FF21501A: g_object_new_internal (gobject.c:1774) ==6481== by 0x31FF216EB4: g_object_new_valist (gobject.c:2033) ==6481== by 0x31FF217220: g_object_new (gobject.c:1617) ==6481== by 0x3D4386F33A: g_proxy_address_new (gproxyaddress.c:325) ==6481== by 0x5717440: proxy_lookup_ready (spice-session.c:2011) ==6481== by 0x3D43885082: g_task_return_now (gtask.c:1088) ==6481== by 0x3D438850B8: complete_in_idle_cb (gtask.c:1102) ==6481== by 0x31FEE4A0B9: g_main_dispatch (gmain.c:3122) ==6481== by 0x31FEE4A0B9: g_main_context_dispatch (gmain.c:3737) ==6481== by 0x31FEE4A44F: g_main_context_iterate.isra.29 (gmain.c:3808) ==6481== by 0x31FEE4A771: g_main_loop_run (gmain.c:4002) ==6481== by 0x363AC06CC4: gtk_main (in /usr/lib64/libgtk-3.so.0.1600.1)
* Make update-symbol-files work when builddir != srcdirJonathon Jongsma2015-04-151-4/+10
| | | | | | rewrite the update-symbol-files rule to use dependencies and automatic variables ($^) so that VPATH will allow make to find these files in the srcdir as well as the builddir.
* channel: HUP is not an error conditionMarc-André Lureau2015-04-141-2/+2
| | | | | | | | | | | | | | | | | On local UNIX sockets, calling close() in the server side will result in a HUP condition on client side. Since this is not an error, but a normal termination, let's ignore it. A clean shutdown would involve a new message to tell the client to first close its end, in order to avoid the HUP. That way the client could distinguish normal termination from unexpected ones. That's a possible future minor enhancement (it seems it would only work with UNIX socket though) G_IO_IN seemed to be a leftover, it is left here but shouldn't be required. https://bugs.freedesktop.org/show_bug.cgi?id=90016
* channel: reset c->has_error when connectedMarc-André Lureau2015-04-141-2/+1
| | | | | | | | | | | Whenever the channel socket is connected, c->has_error should be reset. Until now, only the regular open_host() case was reset, but client client provided fd must also reset the error state. It should be safe to move it after the "connected" label, since the ssl code doesn't need c->has_error. https://bugzilla.redhat.com/show_bug.cgi?id=1211063
* audio: keep compatibility with old pulse versionVictor Toso2015-04-011-0/+10
| | | | | | The commit 9ef68ecd1fd11dea626628 breaks compatibility with old versions of libpulse as the source_output functions were available from version 1.0.0 onwards.
* channel-smartcard: Add missing USE_SMARTCARD checksPavel Grunt2015-03-271-0/+6
| | | | In order to enable build without smartcard support
* smartcard: add reader and cards on channel upMarc-André Lureau2015-03-251-1/+23
| | | | | | | | | | The smartcard manager reports reader/card events on insertion and removal. If a smartcard channel is created after those events, the channel state will not be in sync with the current reader/card state. Sync the state when the channel is up. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1205171
* smartcard: connect object signal handlers with spice helperMarc-André Lureau2015-03-251-8/+8
| | | | | | | | | | The smartcard manager may outlive the smartcard channels. Make sure the channel handlers are disconnected when the channel is free by using spice_g_signal_connect_object() helper. This fixes crashes when dispatching smartcard events on deleted channels. Related bug: https://bugzilla.redhat.com/show_bug.cgi?id=1205171
* audio: use stream functions for pulse sourceVictor Toso2015-03-231-7/+6
| | | | | | The functions pa_context_set_source_output_mute/volume are specifically to change source stream volume/mute. I changed the warnings to be compatible to sink_input ones;
* session: Tone down warning on TLS-only connectionsChristophe Fergeau2015-03-231-1/+2
| | | | | | | | 315c1a5 "session: Add more debugging logs" causes a g_warning() to be shown when attempting a TLS connection without specifying a non-TLS port. This commit makes the message more explicit, and switches it from being a warning to being a debug message.
* channel-usbredir: Do not stop event listening if SpiceSession does not existPavel Grunt2015-03-121-3/+6
| | | | Avoids Segfault when closing the connection just after the usb device redirection.
* build-sys: fix out-of-tree build from tarballMarc-André Lureau2015-03-041-1/+3
| | | | | | | | | There are generated files in build directory too. Fixes: CC util.o In file included from ../../tests/session.c:3:0: ../../gtk/spice-session.h:24:30: fatal error: spice-glib-enums.h: No such file or directory #include "spice-glib-enums.h"
* Prepare v0.28 releaseMarc-André Lureau2015-03-041-0/+19
|
* build-sys: fix required libsoup version for webdav supportMarc-André Lureau2015-03-031-1/+1
|
* Revert spice-common changeMarc-André Lureau2015-03-031-0/+0
| | | | Commit 85ed268 shouldn't have change spice-common, my bad
* session: bind path and read-only to webdav serverMarc-André Lureau2015-03-031-2/+11
| | | | Keep the server property in sync with the session properties
* session: add share-dir-ro propertyMarc-André Lureau2015-03-031-0/+25
| | | | Add a property to specify if share folder access is read-only.
* webdav: use a pipe to connect to serverMarc-André Lureau2015-03-031-21/+62
| | | | | | | | | | | Instead of listening on TCP sockets, and proxying connections there, make the webdav server accept new connections from stream. The streams are user-space GIOStream pipe, one side is connected to the Spice webdav channel muxer/demuxer, the other side is a SoupSocket client. This makes the server not exposed any local public access, avoid the need for server threads, or proxying the connections through system sockets.
* Use libphodav-2 (breaks webdav server temporarily)Marc-André Lureau2015-03-034-201/+26
| | | | | | | | | | | | This change breaks webdav server, since libphodav-2 no longer set up a TCP service running in a thread. It's up to the client to decide how best to accept and handle new connections. This commits remove all the hacks related to proxying the incoming connections to a TCP socket, and protected with a magic sequence. The following commit will use GIOStream pipes to handle each client connections.
* Add GIOStream-based pipeMarc-André Lureau2015-03-036-1/+834
| | | | | | | | | | This code creates a pipe between 2 GIOStream, the input side read from the peer output side, and vice-versa. In the following patches, this will avoid the socket communication to exchange with the embedded webdav server. glib-2.0 >= 2.43.90 because GSimpleIOStream dependency.
* tests: add spice-session testVictor Toso2015-02-272-0/+76
| | | | Checking if URIs are being parsed and generated correctly.
* session: accept argument in URI without valueVictor Toso2015-02-271-2/+18
| | | | | | | | | The examples below should be considered valid URIs: e.g: spice://localhost?port=5900&tls-port= e.g: spice://localhost?tls-port=&port=5900 This patch deals with arguments with empty value;
* vncdisplaykeymap: Use XkbGetMap and XkbGetNames instead of XkbGetKeyboardPavel Grunt2015-02-231-4/+5
| | | | | | XkbGetKeyboard does not work in XWayland (bfo#89240). Fixes https://bugs.freedesktop.org/show_bug.cgi?id=89105
* session: reset connection_id on switch-hostMarc-André Lureau2015-02-181-0/+1
| | | | | | | | | | | The server expects no connection_id during link time, in order to realize a full reconnection. The alternative would be to assume that the destination server has the exact same channels and attempt to recreate and to reconnect them one by one. However, if the destination is slightly different (say, configuration or order of channels differs), this will likely fail. It's best to start with a new session without prior knowledge.
* channel: remove unused ChannelClass::channel_disconnect()Marc-André Lureau2015-02-182-20/+1
| | | | | This virtual method turns out to be unnecessary anymore, and was never override. channel_reset() is enough.
* channel: set c->has_error to finish coroutineMarc-André Lureau2015-02-181-1/+1
| | | | | | It's unnecessary to call channel_disconnect() to finish the coroutine and disconnect. Use c->has_error instead, like the rest of channel error code.
* Call channel_reset() directly when finishing coroutineMarc-André Lureau2015-02-181-1/+1
| | | | | | channel_disconnect() virtual method isn't overloaded by any channel, and can be replaced by the equivalent channel_reset() when finishing the coroutine.
* channel: reset migration state when calling channel_reset()Marc-André Lureau2015-02-181-5/+4
| | | | | | channel_reset() is called in channel_disconnect(). We can just move that state change in channel_reset() in order to get rid of channel_disconnect().