Commit Graph

186 Commits

Author SHA1 Message Date
Christophe Fergeau
7b0de32423 server: use is_primary_surface
red_worker.c has an is_primary_surface helper function, but there
were some places in the file not using it. This patch fixes that
2011-05-02 11:24:43 +02:00
Alon Levy
23ba2ce3e5 server/red_worker: use red_channel_pipe_item_init
replaces in file red_pipe_item_init.
2011-03-02 17:27:53 +02:00
Alon Levy
c771182274 server/red_channel: move out_bytes_counter from Outgoing to RedChannel 2011-03-02 17:27:53 +02:00
Alon Levy
b5ae7133c0 server/red_worker: use red_channel_is_connected 2011-03-02 17:27:53 +02:00
Alon Levy
7890b623b5 server/red_channel: add red_channel_disconnect, use in red_worker
replace channel_release_res in red_worker with red_channel_disconnect.
2011-03-02 17:27:53 +02:00
Alon Levy
d4c187c043 server/red_worker: remove RedChannel argument from add_buf_from_info
It was unused.
2011-03-02 17:27:53 +02:00
Alon Levy
5575d6e5fa server/red_channel: add red_channel_{,no_}item_being_sent 2011-03-02 17:27:53 +02:00
Alon Levy
17ebd6a719 server/red_worker: complete removal of send_data.marshaller use 2011-03-02 17:27:53 +02:00
Alon Levy
992252104c server/red_worker: replace _send_ functions by _marshall_
Changes in display channel for a code size win.

A note about this and the previous cursor change: it will appear that we are
now (with these changes) releasing resources too early. This is not so - send
always has the option of blocking, which means after send you can not release
resources anyway, that's what the release_item callback is for. So both the
code before and now are doing the same accounting.
2011-03-02 17:27:52 +02:00
Alon Levy
88db43879b server/red_channel: add red_channel_send_message_pending 2011-03-02 17:27:52 +02:00
Alon Levy
7a650e9641 server/red_channel: add red_channel_all_blocked 2011-03-02 17:27:52 +02:00
Alon Levy
b7dbc14b1c server/red_worker: cursor channel: replace _send_ with _marshall_ 2011-03-02 17:27:52 +02:00
Alon Levy
a05628bf06 server/red_channel (all): add red_channel_get_stream
use in config_socket, this makes the stream internal to the RedChannel
implementation that will change later for multiple client support.
2011-03-02 17:27:52 +02:00
Alon Levy
ce03dcfbb5 server/red_channel (all): handle MIGRATE_DATA and MIGRATE_FLUSH_DATA
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).
2011-03-02 17:27:51 +02:00
Alon Levy
8002a30f9c server/red_channel (all): add red_channel_get_marshaller
For ussage in the send_item callback. It's only valid during this
time anyway (should make it return NULL in other occasions?)

No more direct usage of RedChannel.send_data.marshaller by channels.
2011-03-02 17:27:51 +02:00
Alon Levy
9e46945a61 server/red_worker: use red_channel_destroy 2011-03-02 17:27:51 +02:00
Alon Levy
5e1ba1101b server/red_channel: move SET_ACK to red_channel 2011-03-02 17:27:51 +02:00
Alon Levy
2fcd35b073 server/red_channel: add more ack api 2011-03-02 17:27:51 +02:00
Alon Levy
766bb420bb server: use red_channel_get_message_serial 2011-03-02 17:27:51 +02:00
Alon Levy
17b6a58f1e server/red_channel (all): makes red_channel_reset_send_data private
ready the way for handling ack messages in RedChannel.
2011-03-02 17:27:51 +02:00
Alon Levy
cd99a0b4b3 server/red_worker: use red_channel 2011-03-02 17:27:50 +02:00
Alon Levy
73858b93dc server/red_worker: introduce red_peer_handle_outgoing and OutgoingHandler
From red_channel.
2011-03-02 17:27:50 +02:00
Alon Levy
29a7bcd596 server/red_worker: introduce common_channel_config_socket 2011-03-02 17:27:50 +02:00
Alon Levy
beba2c7206 server/red_worker: line width fix 2011-03-02 17:27:50 +02:00
Alon Levy
724348ce49 server/red_worker: don't push to NULL channel (called from device input) 2011-03-02 17:27:50 +02:00
Alon Levy
705254b399 server/red_worker: introduce red_channel_pipe_clear
No more common_release_pipe_item
2011-03-02 17:27:50 +02:00
Alon Levy
a0a9718423 server/red_worker: add red_channel_push 2011-03-02 17:27:50 +02:00
Alon Levy
111cf51103 server/red_worker: add send_item 2011-03-02 17:27:50 +02:00
Alon Levy
f7a99f858e server/red_worker: red_channel renames
The renames are part of refactoring red_worker's RedChannel to reuse
red_channel.h's RedChannel at the end.

s/red_send_data/red_channel_send/
s/red_pipe_get/red_channel_pipe_get/
s/recive_data/incoming/
s/red_receive/red_channel_receive/
s/channel_handle_message/red_channel_handle_message/
s/channel_is_connected/red_channel_is_connected/
s/red_pipe_add_type/red_channel_pipe_add_type/
2011-03-02 17:27:49 +02:00
Marc-André Lureau
76dc27f08a server: rename s/peer/stream
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
2011-02-28 16:36:35 +01:00
Marc-André Lureau
fc5d7f7625 server: use the new reds_stream_{read,write}
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:28 +01:00
Marc-André Lureau
b79e7320de server: add reds_stream_{read,write,free,remove_watch}()
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-27 18:26:15 +01:00
Marc-André Lureau
d47912241f server: s/RedsStreamContext/RedsStream
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-27 16:55:22 +01:00
Alon Levy
0b687d9b23 server/red_worker: cursor_channel_send_item: don't downcast 2011-02-11 15:32:21 +02:00
Alon Levy
bb7cbceb97 server/red_worker: match channel_release_pipe_item_proc to red_channel 2011-02-11 15:32:21 +02:00
Alon Levy
53f5cf43ce server/red_worker: introduce an outgoing struct around out_bytes_counter 2011-02-11 15:32:21 +02:00
Alon Levy
d7521edac1 server/red_worker: renames to add channel_ prefix and consistent sig
s/disconnect_channel_proc/channel_disconnect_proc/
s/release_item_proc/channel_release_pipe_item_proc/
s/handle_message_proc/channel_handle_parsed_proc/

Adds RedChannel* channel as first parameter to hold_pipe_item_proc
2011-02-11 15:32:21 +02:00
Alon Levy
f8d3345ef7 server/red_worker: split cursor_channel_send_item
Split from cursor_channel_push
2011-02-11 15:32:21 +02:00
Alon Levy
67b3bf20d0 server/red_worker: use red_channel begin_send_message
s/red_begin_send_message/red_channel_begin_send_message/
2011-02-11 15:32:21 +02:00
Alon Levy
7d53a51da0 server/red_worker: add red_channel_init_send_data
Changes semantics of send to always hold/release regardless of block, like
red_channel. A hold is just a reference count increment or nop.
2011-02-11 15:32:21 +02:00
Alon Levy
859aa15806 server/red_worker: split display_channel_send_item
Split it out of display_channel_push.
2011-02-11 15:32:21 +02:00
Alon Levy
f8262c80ad server/red_worker: extract common_release_pipe_item from red_pipe_clear 2011-02-11 15:32:21 +02:00
Alon Levy
e588176dab server/red_worker: use red_channel pipe add versions
s/red_pipe_add/red_channel_pipe_add/
s/red_pipe_add_after/red_channel_pipe_add_after/
2011-02-11 15:32:21 +02:00
Alon Levy
a0a958c77b server/red_worker: shorten some lines using alias variables 2011-02-11 15:32:21 +02:00
Alon Levy
e8698ea0f8 server/red_worker: introduce CommonChannel
with everything (almost) not in red_channel's RedChannel

As a result of CommonChannel a free cb is added to EventHandler,
to take care of non zero offset for embedded EventHandler.
2011-02-11 15:32:20 +02:00
Alon Levy
9330dbac13 server/red_worker: use ack_data struct
start of move to red_channel based channels
2011-02-11 15:32:20 +02:00
Alon Levy
a185c1daf0 server/red_worker: change hold_item sig, drop the void*
changed to PipeItem *
2011-02-11 15:32:20 +02:00
Alon Levy
7dfd7a0c77 server/red_channel: add hold_item (from red_worker)
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.
2011-02-07 19:21:21 +02:00
Alon Levy
31db6ef8c2 server/red_worker: fix used but uninitialized warning (gcc 4.6.0) 2011-02-07 15:10:36 +02:00
Alon Levy
46c70521d5 client/server: warning fixes (gcc 4.6.0)
gcc 4.6.0 added "[-Werror=unused-but-set-variable]", this and the next
few fixes tend to that. Mostly harmless.
2011-01-25 17:22:48 +02:00