summaryrefslogtreecommitdiffstats
path: root/server/red_tunnel_worker.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove tunneling supportChristophe Fergeau2013-10-281-3481/+0
| | | | | | It's depending on an unmaintained package (slirp), and I don't think anyone uses that code. It's not tested upstream nor in fedora, so let's remove it.
* red_tunnel_worker: Fix build error due to missing monitor_latency argumentAxel Lin2013-10-181-1/+1
| | | | | | Fix missing monitor_latency argument in red_channel_client_create call. Signed-off-by: Axel Lin <axel.lin@ingics.com>
* server/red_tunnel_worker: remove unneeded expect_migrate_markAlon Levy2012-08-301-6/+0
|
* server/red_tunnel_worker.c: fix buildAlon Levy2012-08-281-44/+18
| | | | Only passes compile, not tested.
* server: handle red_channel_client_create returning NULLYonit Halperin2012-05-211-1/+3
|
* Use the spice-common logging functionsMarc-André Lureau2012-03-251-119/+121
| | | | | It will abort by default for critical level messages. That behaviour can be tuned at runtime.
* Use spice_strdup() to avoid crashing on NULLMarc-André Lureau2012-03-231-2/+2
| | | | | qemu can call spice_server_set_name(s, NULL) when the name is not given. Let's not crash in this case
* Ensure all members of ChannelCbs and ClientCbs are either assigned or NULLHans de Goede2012-03-101-2/+2
| | | | | | | | | | | | | | | While git-bisecting another issue I ended up hitting and not recognizing the bug fixed by commit 7a079b452b026d6ce38f95dcc397fa64b059fffb. While fixing this (again) I noticed that (even after the fix) not all users of ChannelCbs first zero it. So this patch ensures that all users of ChannelCbs first zero it, and does the same for ClientCbs while at it. Since before this patch there were multiple zero-ing styles, some using memset and other using a zero initializer this patch also unifies all the zero-ing to use a NULL initializer for the first element. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* server: Don't complain if setsockopt NODELAY fails on unix socketsHans de Goede2012-01-181-1/+3
| | | | | | | | | | | | With Daniel P. Berrange's patches to allow use of pre-supplied fd's as channels, we can no longer be sure that our connections are TCP sockets, so it makes no sense to complain if a TCP/IP specific setsockopt fails with an errno of ENOTSUP. Note that this extends Daniel's commit 492ddb5d1d595e2d12208f4602b18e4432f4e6b4 which already added the same check to server/inputs_channel.c Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Remove trailing blank linesDaniel P. Berrange2012-01-131-1/+0
| | | | Remove any blank lines at the end of all source files
* Remove 'the the' typosDaniel P. Berrange2012-01-131-1/+1
|
* server: Limit the access to SpiceDataHeader of messages - only via red_channel.Yonit Halperin2012-01-121-21/+22
|
* server: set & test channel capabilities in red_channelYonit Halperin2011-11-021-1/+2
| | | | | | | 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: registering RedChannel in reds, instead of ChannelYonit Halperin2011-08-231-104/+107
| | | | | | | | | | | | | | | | | | | | | | | 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: pack all channel callbacks to ChannelCbsYonit Halperin2011-08-231-10/+13
|
* server/red_tunnel_worker: trivial multi client supportAlon Levy2011-08-231-122/+133
| | | | | | | | | | | | 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: Add RedClientAlon Levy2011-08-231-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That means RedClient tracks a ring of channels. Right now there will be only a single client because of the disconnection mechanism - whenever a new client comes we disconnect all existing clients. But this patch adds already a ring of clients to reds.c (stored in RedServer). There is a known problem handling many connections and disconnections at the same time, trigerrable easily by the following script: export NEW_DISPLAY=:3.0 Xephyr $NEW_DISPLAY -noreset & for ((i = 0 ; i < 5; ++i)); do for ((j = 0 ; j < 10; ++j)); do DISPLAY=$NEW_DISPLAY c_win7x86_qxl_tests & done sleep 2; done I fixed a few of the problems resulting from this in the same patch. This required already introducing a few other changes: * make sure all removal of channels happens in the main thread, for that two additional dispatcher calls are added to remove a specific channel client (RED_WORKER_MESSAGE_CURSOR_DISCONNECT_CLIENT and RED_WORKER_MESSAGE_DISPLAY_DISCONNECT_CLIENT). * change some asserts in input channel. * make main channel disconnect not recursive * introduce disconnect call back to red_channel_create_parser The remaining abort is from a double free in the main channel, still can't find it (doesn't happen when running under valgrind - probably due to the slowness resulting from that), but is easy to see when running under gdb.
* server: move pipe from RedChannel to RedChannelClientAlon Levy2011-08-231-13/+13
| | | | | | | | | | | | | | | | | | | | | | | Another cleanup patch, no change to behavior (still one client, and it disconnects previous client if any). The implementation for multiple client is straightforward: the pipe remains per (channel,client) pair, so it needs to move from the RedChannel that to RedChannelClient. Implementation using a single pipe with multiple consumers (to reflect different latencies) doesn't fit well with pipe rewriting that is used by the display channel. Additionally this approach is much simpler to verify. Lastly it doesn't add considerable overhead (but see the display channel changes in a later patch for a real place to rethink). This patch is just technical, changing signatures to reflect the first argument (oop style) so red_channel becomes red_channel_client. Some places may seem odd but they should be fixed with later comits where the channels grow to support multiple clients. Sound (playback/record) channels are the only ones not touched - this is consistent with previous patches, since they have been left out of the RedChannel refactoring. That is left as future work. (note that they don't use a pipe, which was the reason for not refactoring).
* server/red_channel (all): introduce RedChannelClientAlon Levy2011-08-231-92/+122
| | | | | | | | | | | | | | | | | | | | | This commit adds a RedChannelClient that now owns the stream connection, but still doesn't own the pipe. There is only a single RCC per RC right now (and RC still means RedChannel, RedClient will be introduced later). All internal api changes are in server/red_channel.h, hence the need to update all channels. red_worker.c is affected the most because it makes use of direct access to some of RedChannel still. API changes: 1. red_channel_client_create added. rec_channel_create -> (red_channel_create, red_channel_client_create) 2. two way connection: rcc->channel, channel->rcc (later channel will hold a list, and there will be a RedClient to hold the list of channels per client) 3. seperation of channel disconnect and channel_client_disconnect TODO: usbredir added untested.
* s/__visible__/SPICE_GNUC_VISIBLEChristophe Fergeau2011-06-221-2/+2
| | | | | The C specification reserves use of identifiers starting with __ to the compiler so we shouldn't use one such symbol.
* add #include <config.h> to all source filesChristophe Fergeau2011-05-031-0/+3
| | | | | | | | When using config.h, it must be the very first include in all source files since it contains #define that may change the compilation process (eg libc structure layout changes when it's used to enable large file support on 32 bit x86 archs). This commit adds it at the beginning of all .c and .cpp files
* server/red_channel (+): remove red_channel_add_bufAlon Levy2011-03-021-32/+36
|
* server/tunnel: pass SpiceMarshaller reference from sendAlon Levy2011-03-021-54/+37
| | | | | | | | Introduce SpiceMarshaller param to all send's that do add_buf Next patch will use marshaller in all functions that currently don't by replacing red_channel_add_buf with marshaller add_ref. Note - currently tunnel is broken due to wrong size in messages.
* server/red_channel (all): add red_channel_get_streamAlon Levy2011-03-021-3/+4
| | | | | use in config_socket, this makes the stream internal to the RedChannel implementation that will change later for multiple client support.
* server/red_channel (all): handle MIGRATE_DATA and MIGRATE_FLUSH_DATAAlon Levy2011-03-021-16/+27
| | | | | | | | | | Handling done in red_channel instead of per channel, using call backs for the channel specific part. Intended to reduce furthur reliance of channels on RedChannel struct. The commit makes the code harder to understand because of the artificial get_serial stuff, should later be fixed by having a joint migration header with the serial (since all channels pass it).
* server/red_channel: move SET_ACK to red_channelAlon Levy2011-03-021-20/+2
|
* server/red_channel (all): makes red_channel_reset_send_data privateAlon Levy2011-03-021-1/+0
| | | | ready the way for handling ack messages in RedChannel.
* server/red_channe: make hold_item take a channel argAlon Levy2011-03-021-1/+1
|
* server/red_tunnel_worker: use message_serial setter and getterAlon Levy2011-03-021-2/+2
| | | | fixes breakage in --enable-tunnel compilation.
* server: rename s/peer/streamMarc-André Lureau2011-02-281-6/+6
| | | | | | | | This is stylish change again. We are talking about a RedStream object, so let's just name the variable "stream" everywhere, to avoid confusion with a non existent RedPeer object. https://bugs.freedesktop.org/show_bug.cgi?id=34795
* server: s/RedsStreamContext/RedsStreamMarc-André Lureau2011-02-271-2/+2
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=34795
* server/red_channel (tunnel): change sig of red_channel_handle_messageAlon Levy2011-02-071-2/+2
| | | | for later usage with red_worker
* server/red_channel: add hold_item (from red_worker)Alon Levy2011-02-071-0/+5
| | | | | | | | | | | | | hold_item called on init_send_data, matching release. This is not the behavior of red_worker - we ref++ (==hold_item) when sending the item, and --refs when releasing it, instead of only holding if the send is blocked. Note 1: Naming: hold_pipe_item is the proc name, the variable is called hold_item, this is similar to release_item/release_pipe_item naming. Note 2: All channels have empty implementation, we later use this when red_worker get's RedChannelized.
* codegen: Various cleanupsAlexander Larsson2010-07-191-6/+5
| | | | | | | | | | | | Remove all uses of @end in the marshaller, instead just using the C struct array-at-end-of-struct. To make this work we also remove all use of @end for switches (making them C unions). We drop the zero member of the notify message so that we can avoid this use of @end for a primitive in the marshaller (plus its useless to send over the wire). We change the offsets and stuff in the migration messages to real pointers.
* Missed some misspelling fixesAlexander Larsson2010-07-081-11/+11
|
* Fix spelling errors in comments and stringsAlexander Larsson2010-05-211-18/+18
|
* complete NetWireInterface redesign, make red_tunnel_worker.c build.Gerd Hoffmann2010-05-191-11/+14
|
* s/CoreInterface/SpiceCoreInterface/Gerd Hoffmann2010-05-191-2/+3
|
* minor timer interface cleanups.Gerd Hoffmann2010-05-191-3/+2
| | | | | | Make the timer interface largely look like the watch interface. Simliar naming convention for the functions (timer_*) and a opaque SpiceTimer type.
* Relicense everything from GPL to LGPL 2.1+Alexander Larsson2010-04-131-12/+12
|
* Use spice allocator in server/Alexander Larsson2010-03-111-55/+14
|
* Use macros from <spice/macros.h> rather than duplicate themAlexander Larsson2010-03-091-18/+18
|
* Use the new header namesAlexander Larsson2010-02-041-1/+1
| | | | | | I just ran: find -name "*.[ch]" | xargs sed -i -f ../spice-protocol/includes.sed find -name "*.cpp" | xargs sed -i -f ../spice-protocol/includes.sed
* Rename symbols that were changed in spice-protocolAlexander Larsson2010-02-041-112/+112
| | | | | | This is an automatic change using: $ find -name "*.[ch]" | xargs ../spice-protocol/rename-identifiers.sh ../spice-protocol/renames $ find -name "*.cpp" | xargs ../spice-protocol/rename-identifiers.sh ../spice-protocol/renames
* tunnelYonit Halperin2009-10-181-0/+3510