summaryrefslogtreecommitdiffstats
path: root/server/main_dispatcher.c
Commit message (Collapse)AuthorAgeFilesLines
* server, separate SpiceChannelEventInfo from RedStreamAlon Levy2012-02-231-0/+3
| | | | | | | | | | fixes rhbz 790749 use after free of SpiceChannelEventInfo. The lifetime of the SpiceChannelEventInfo was that of RedsStream, but it is used by main_dispatcher_handle_channel_event after the RedsStream is freed for the cursor and display channels. Making SCEI allocation be at RedsStream allocation, and deallocation after the DESTROY event is processed by core->channel_event, fixes use after free.
* Add missing includes of config.hDaniel P. Berrange2012-01-131-0/+1
| | | | Not all files were including config.h
* Remove unused assert.h includeDaniel P. Berrange2012-01-131-1/+0
| | | | The assert.h include was never used in any code
* server: introduce dispatcherAlon Levy2011-11-081-75/+27
| | | | | | | | | | | | | | | | | | | | | | | | used for main_dispatcher only in this patch. Dispatcher is meant to be used for Main<->any low frequency messages. It's interface is meant to include the red_dispatcher usage: fixed size messages per message type some messages require an ack Some methods are added to be used by RedDispatcher later: dispatcher_handle_read - to be called directly by RedDispatcher epoll based loop dispatcher_set_opaque - to be set from red_worker pthread dispatcher_init - allow NULL core as used by red_worker Read and Write behavior: Sender: blocking write, blocking read for ack (if any). Reader: poll for any data, if such then blocking read for a message_type and following message. repeat until poll returns with no pending data to read. FDO Bugzilla: 42463
* [0.8 branch] server: add main_dispatcherAlon Levy2011-10-311-0/+145
add main_dispatcher, a message passing mechanism for sending messages to the main thread. The main thread is the thread that implements SpiceCoreInterface, which is assumed to be a single thread. Similar to the async operation of red_worker, a socket pair is created and used to pass messages. The messages are a fixed size to ease parsing. A single message is defined to pass a channel_event. RHBZ: 746950 FDBZ: 41858 This patch is 0.8 branch only, for the master branch there should be a better approach to share code with red_dispatcher and ready the way for later adding more threads. cherry-pick from 0.8 80caf07e09efe14c67f89a3c01501a6a39681167 Conflicts: server/reds.c