summaryrefslogtreecommitdiffstats
path: root/server/red_channel.h
Commit message (Collapse)AuthorAgeFilesLines
* red channel: Remove unused red_channel_apply_clients_dataPavel Grunt2015-11-231-1/+0
| | | | | | | | It was introduced in 7e8e13593ee681cf04c349bca57dd225d7802494 but never used. Signed-off-by: Pavel Grunt <pgrunt@redhat.com> Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
* red channel: Remove unused declaration of red_channel_pipes_removePavel Grunt2015-11-231-2/+0
| | | | | | | | It was introduced in 09ae4700d27b7c1cca64c2ce4c90f0c6cdf81ccf but never used. Signed-off-by: Pavel Grunt <pgrunt@redhat.com> Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
* red channel: Remove unused red_channel_push_set_ackPavel Grunt2015-11-231-1/+0
| | | | | | | It is not needed since 8e7b22b7861d2859167767822f29749bfe3ecc16 Signed-off-by: Pavel Grunt <pgrunt@redhat.com> Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
* server: Duplicate typedef definitions are not allowed in C99Francois Gouget2015-11-161-1/+0
| | | | | | | This fixes some compilation errors with gcc 4.4.7 on RHEL 6. Signed-off-by: Francois Gouget <fgouget@codeweavers.com> Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
* server: make more of cursor privateMarc-André Lureau2015-11-031-0/+2
| | | | Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
* server: make cursor channel privateMarc-André Lureau2015-11-031-0/+6
| | | | Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
* server: small move to red_channelMarc-André Lureau2015-10-151-0/+6
| | | | | Acked-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
* RedChannel: remove unused BufDescriptor structJonathon Jongsma2015-08-111-5/+0
|
* server: use more const CoreInterfaceMarc-André Lureau2015-08-111-3/+3
|
* Add const to test_capability first argumentChristophe Fergeau2014-11-241-1/+1
| | | | We don't modify the capabilities content, so it can be marked as const.
* Fix test_capability() typoChristophe Fergeau2014-03-131-1/+1
| | | | It was spelt 'capabilty'
* Add reds_stream.[ch]Christophe Fergeau2014-01-201-1/+1
| | | | | Gather common RedsStream code there rather than having it in reds.c
* red_channel: cleanup of red_channel_client blocking methodsYonit Halperin2013-09-261-8/+14
| | | | | | (1) receive timeout as a parameter. (2) add a return value and pass the handling of failures to the calling routine.
* red_channel: add option to monitor whether a channel client is aliveYonit Halperin2013-08-141-0/+14
| | | | | | | | | | rhbz#994175 When a client connection is closed surprisingly (i.e., without a FIN segment), we cannot identify it by a socket error (which is the only way by which we identified disconnections so far). This patch allows a channel client to periodically check the state of the connection and identify surprise disconnections.
* red_channel: add on_input callback for tracing incoming bytesYonit Halperin2013-08-141-0/+2
| | | | The callback will be used in the next patch.
* server: s/red_wait_all_sent/red_channel_wait_all_sent/Alon Levy2013-08-141-1/+1
|
* server: move three functions to red_channelAlon Levy2013-08-141-0/+10
| | | | | | | | | | | | | | | Three blocking functions, one was split to leave the display channel specific referencing of the DrawablePipeItem being sent inside red_worker, but the rest (most) of the timeout logic was moved to red_channel, including the associated constants. Moved functions: red_channel_client_wait_pipe_item_sent red_wait_outgoing_item red_wait_all_sent Introduces red_time.h & red_time.c for a small helper function dealing with time.h
* red_channel: add ref count to RedClientYonit Halperin2013-07-291-2/+15
|
* red_channel: add spice_channel_client_errorYonit Halperin2013-05-081-0/+11
| | | | | | | | spice_channel_client_error prints warning and shutdowns the channel_client that hit the error. This macro is useful for errors that are specific for one session and that are unrecoverable only with respect to this session. Prefer disconnecting a client over aborting when possible.
* red_channel: monitor connection latency using MSG_PINGYonit Halperin2013-04-221-0/+18
|
* red_channel: remove unused migrate flag from RedChannelYonit Halperin2012-08-271-3/+2
| | | | The relevant flags reside in RedChannelClient and RedClient
* red_channel (dummy): fix not adding dummy RedChannelClient to the clientYonit Halperin2012-08-271-2/+2
| | | | | | | | | | | snd channel wasn't added to be part of the client's channels list. As a result, when the client was destroyed, or migrated, snd channel client wasn't destroy, or its migration callback wasn't called. However, due to adding dummy channels to the client, we need special handling for calls to disconnecting dummy channel clients. TODO: we need to refactor snd_worker to use red_channel
* red_channel: introduce PIPE_ITEM_TYPE_EMPTY_MSGYonit Halperin2012-08-271-0/+4
| | | | The pipe item is used for sending messages that don't have body.
* seamless migration: migration completion on the destination sideYonit Halperin2012-08-271-2/+26
| | | | | | Tracking the channels that wait for migration data. If there is a new migration process pending, when all the channels have restored their state, we begin the new migration.
* red_channel: handle sending SPICE_MSG_MIGRATEYonit Halperin2012-08-271-3/+11
| | | | | | | The relevant code is common to all channels. The patch also contains a fix to the return value for handle_migrate_data callback: s/uint64_t/int
* red_channel: add red_channel_test_remote_capYonit Halperin2012-08-271-0/+4
| | | | for checking if all the channel clients connected support the cap
* server/red_channel: fix possible access to released channel clientsYonit Halperin2012-05-311-0/+5
| | | | | | | | | | | | | Added ref count for RedChannel and RedChannelClient. red_channel.c/red_peer_handle_incoming call to handler->cb->handle_message might lead to the release of the channel client, and the following call to handler->cb->release_msg_buf will be a violation. This bug can be produced by causing main_channel_handle_parsed call red_client_destory, e.g., by some violation in reds_on_main_agent_data that will result in a call to reds_disconnect.
* server/red_channel: remove red_channel_client_item_being_sentYonit Halperin2012-05-241-9/+0
| | | | | | The above routine was risky, since red_channel_client_init_send_data can also be called with item==NULL. Thus, not all pipe items can be tracked. The one call that was made for this routine was not necessary.
* Use the spice-common submoduleMarc-André Lureau2012-03-251-4/+5
| | | | | | | | | | | | | | | | | | This patch will replace the common/ directory with the spice-common project. It is for now a simple project subdirectory shared with spice-gtk, but the goal is to make it a proper library later on. With this change, the spice-server build is broken. The following commits fix the build, and have been seperated to ease the review. v2 - moves all the generated marshallers to spice-common library - don't attempt to fix windows VS build, which should somehow be splitted with spice-common (or built from tarball only to avoid generation tools/libs deps) v3 - uses libspice-common-client - fix a mutex.h inclusion reported by Alon
* red_channel: remove pre_disconnect hookHans de Goede2012-03-121-1/+0
| | | | | | Now that red_worker's EventListener is gone there are no more users of it. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Use standard IOV_MAX definition where applicableDan McGee2012-02-211-3/+8
| | | | | | | | This is provided by <limits.h> on all platforms as long as _XOPEN_SOURCE is defined. On Linux, this is 1024, on Solaris, this is 16, and on any other platform, we now respect the value supported by the OS. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
* red_worker: reimplement event loop using poll()Dan McGee2012-02-211-0/+1
| | | | | | | | | | | | | | | | | | This removes the epoll dependency we had in red_worker, which was the last Linux-specific call we were using in the entire Spice server. Given we never have more than 10 file descriptors involved, there is little performance gain had here by using epoll() over poll(). The biggest change is introduction of a new pre_disconnect callback; this is because poll, unlike epoll, cannot automatically remove file descriptors as they are closed from the pollfd set. This cannot be done in the existing on_disconnect callback; that is too late as the stream has already been closed and the file descriptor lost. The on_disconnect callback can not be moved before the close and other operations easily because of some behavior that relies on client_num being set to a certain value. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
* server/spicevmc: Don't destroy the rcc twiceHans de Goede2012-02-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | spicevmc calls red_channel_client_destroy() on the rcc when it disconnects since we don't want to delay the destroy until the session gets closed as spicevmc channels can be opened, closed and opened again during a single session. This causes red_channel_client_destroy() to get called twice, triggering an assert, when a connected channel gets destroyed. This was fixed with commit ffc4de01e6f9ea0676f17b10e45a137d7e15d6ac for the case where: a spicevmc channel was open on client disconnected, and the main channel disconnect gets handled first. But the channel can also be destroyed when the chardev gets unregistered with the spice-server. This path still triggers the assert. This patch fixes this by adding a destroying flag to the rcc struct, and also moves the previous fix over to the same, more clean, method of detecting this special case. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* server: add support for SPICE_COMMON_CAP_MINI_HEADERYonit Halperin2012-01-121-4/+31
| | | | | | | | | Support for a header without a serial and without sub list. red_channel: Support the two types of headers. Keep a consistent consecutive messages serial. red_worker: use urgent marshaller instead of sub list. snd_worker: Sound channels need special support since they still don't use red_channel for sending & receiving.
* server: Limit the access to SpiceDataHeader of messages - only via red_channel.Yonit Halperin2012-01-121-14/+10
|
* server/red_channel: introduce urgent marshallerYonit Halperin2012-01-121-1/+26
| | | | | | | | | | When red_channel::red_channel_client_begin_send_message is called, the message that is pending in the urgent marshaller will be sent before the one in the main channel. The urgent marshaller should be used if in the middle of marshalling one message, you find out you need to send another message before. This functionality is equivalent to the sub_list messages. It will replace them in the following patches, when sub_list is removed from Spice data header.
* server: handling semi-seamless migration in the target sideYonit Halperin2011-11-021-2/+4
| | | | | | | | | | (1) not sending anything to a migrated client till we recieve SPICE_MSGC_MIGRATE_END (2) start a new client migration (handle client_migrate_info) only after SPICE_MSGC_MIGRATE_END from the previous migration was received for this client (3) use the correct ticket Note: we assume the same channles are linked before and ater migration. i.e., SPICE_MSGC_MAIN_ATTACH_CHANNELS is not sent from the clients.
* server,proto: tell the clients to connect to the migration target before ↵Yonit Halperin2011-11-021-1/+1
| | | | | | | | | | | | | | | migraton starts (1) send SPICE_MSG_MAIN_MIGRATE_BEGIN upon spice_server_migrate_connect (to all the clients that support it) (2) wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) from all the relevant clients, or a timeout, in order to complete client_migrate_info monitor command (cherry picked from commit 5560c56ef05c74da5e0e0825dc1f134019593cad branch 0.8; Was modified to support the separation of main channel from reds, and multiple clients) Conflicts: server/reds.c
* server: set & test channel capabilities in red_channelYonit Halperin2011-11-021-7/+26
| | | | | | | The code for setting and testing channel capabilities was unnecessarily duplicated. Now it is in red_channel. RedsChannel was dropped from Reds; It was used only for holding the channels common capabilities, which are now held in RedChannel.
* server: fix function prototypesChristophe Fergeau2011-09-051-1/+1
| | | | | | | | Several functions in server/ were not specifying an argument list, ie they were declared as void foo(); When compiling with -Wstrict-prototypes, this leads to: test_playback.c:93:5: erreur: function declaration isn’t a prototype [-Werror=strict-prototypes]
* server/snd_worker.c: add red_channel_client_destroy_dummyAlon Levy2011-08-231-0/+1
|
* server: registering RedChannel in reds, instead of ChannelYonit Halperin2011-08-231-22/+48
| | | | | | | | | | | | | | | | | | | | | | | 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.
* server/red_channel.c inroducing client_cbsYonit Halperin2011-08-231-0/+28
| | | | | client_cbs are supposed to be called from client context (reds). This patch will be used in future patches for relacing reds::Channel with RedChannel in order to eliminate redundancy.
* server/red_channel.c: pack all channel callbacks to ChannelCbsYonit Halperin2011-08-231-28/+20
|
* server/red_channel: introduce client ring in RedChannelAlon Levy2011-08-231-6/+11
| | | | | | | | | | | | | | | | | Also adds Drawable pipes and glz rings. main_channel and red_worker had several locations that still accessed rcc directly, so they had to be touched too, but the changes are minimal. Most changes are in red_channel: drop the single client reference in RedChannel and add a ring of channels. Things missing / not done right in red_worker: * StreamAgents are in DCC - right/wrong? * GlzDict is multiplied - multiple compressions. We still are missing: * remove the disconnect calls on new connections
* server/red_channel: add pipe_size helpersAlon Levy2011-08-231-0/+7
|
* server/red_worker: multiple client support - base splitAlon Levy2011-08-231-2/+0
| | | | | | | | | | | | | | | | | | This patch compiles but breaks spice. Split both display and cursor channels to a client part and channel part. Introduce DisplayChannelClient, CursorChannelClient, CommonChannelClient. don't disconnect channel on client disconnect. Move all caches to the ChannelClient's. Remove reference counting of the channel. No new functionality introduced. NOTE: Introduces a crash in disconnections, a regression, resulting from incorrect thread access, that is fixed in the patch titled: "server: registering RedChannel in reds, instead of Channel"
* server/red_tunnel_worker: trivial multi client supportAlon Levy2011-08-231-1/+1
| | | | | | | | | | | | s/TunnelChannel/TunnelChannelClient/ That's about it. this is probably the wrong way to do it. Not tested at all. What do we want, a separate interface per client? same interface for all clients? probably the later. This doesn't do that. Not tested, so probably doesn't even work. changes red_channel_pipe_item_is_linked to red_channel_client_pipe_item_is_linked, since tunnel channel is the only user, must be done in patch to not break compilation.
* server/red_channel: introduce pipes functionsAlon Levy2011-08-231-4/+14
| | | | | | | | | | Introduce functions to add (via producer method) the same item to multiple pipes, all for the same channel. Note: Right now there is only a single channel, but the next patches will do the per-channel breakdown to channel and channel_client before actually introducing a ring in RedChannel, this makes it easier to make smaller changes - the channel->rcc link will exist until removed in the ring introducing patch.
* server/main_channel: move ping here from reds.Alon Levy2011-08-231-0/+2
| | | | | | | | | | | | | cleanup only. Note that the ping function is half used since the opt parameter stopped being called with anything but NULL, should be returned at some point, specifically when we drop the 250kbyte ping on start and do a continuous check for latency and bandwidth. See: 81945d897 - server: add new vd interface QTerm2Interface, Yaniv Kamay introducing the usage of ping with a non NULL opt 3f7ea8e7a - zap qterm interfaces, Gerd Hoffman removing it