Commit graph

17 commits

Author SHA1 Message Date
Kristian Høgsberg
1c5578e87f connection: Just look at buffer size and remove redundant n_fds_out
Instead of maintaining a count of the fds in the buffer, just compute
that from the buffer size.  That way we don't get out of sync.
2012-03-23 00:48:19 -04:00
Kristian Høgsberg
cab70c9e5d connection: Set n_fds_out to 0 when we send out the fds
This needs to happen always, not just when the fd buffer overflows.
2012-03-23 00:27:04 -04:00
Ander Conselvan de Oliveira
73d4a53672 Flush the connection if we have to many marshaled fds
The buffer used by wl_connection_data to receive a cmsg is 128 bytes
long. This can hold at most 28 fds but when a cmsg is generated for
sending the fds, there is no check for this limitation. The man page
for recvmsg does not show any way of recovering from MSG_CTRUNC, that
happens when the buffer supplied for cmsg is too short.

Fix this by flushing the data to be written instead of generating a
cmsg buffer longer than the maximum.
2012-03-10 16:01:46 -05:00
Kristian Høgsberg
ac80c54f18 connection: Export wl_connection_queue() so we can test it 2012-03-02 23:38:31 -05:00
Kristian Høgsberg
b26774da5b Don't block when flushing a full protocol buffer
In case the client isn't responding, this will block the compositor.
Instead we flush with MSG_DONTWAIT, which lets us fill up the kernel buffer
as much as we can (after not returning EPOLLOUT anymore it still can take
80k more), and then disconnect the client if we get EAGAIN.
2012-02-29 11:07:48 -05:00
Kristian Høgsberg
1b31149f92 connection: Fix printf format warnings 2011-12-17 16:05:44 -05:00
Laszlo Agocs
34901868b8 Increase closure buffer size and fail gracefully for too big closures.
Buffer size changed from 256 to 1024 bytes. Marshalling will now stop
if the buffer is not big enough.
2011-12-17 16:02:05 -05:00
Kristian Høgsberg
eae3bcb4cc New drag and drop / selection protocol
This commit brings a big change to the DND and copy/paste interfaces.
Most importantly the functionality is now independent of wl_shell.
The wl_shell interface is intended for desktop style UI interaction and
an optional and experimental interface.

The new interface also allows receiving the DND data multiple times or
multiple times during the drag, and the mechanism for offering and receiving
data is now shared between DND and selections.
2011-11-23 16:05:58 -05:00
Kristian Høgsberg
190492b97c debug: Use unsigned for object IDs 2011-11-22 14:04:10 -05:00
Kristian Høgsberg
cf04b0a18f Move private definitions and prototypes to new wayland-private.h 2011-11-18 13:46:56 -05:00
Kristian Høgsberg
4abc56bd6d Introduce wl_resource_queue_event() for sending events later
Some events, such as the display.delete_id, aren't very urgent and we
would like to not always send them immdiately and cause an unnecessary
context switch.  The wl_resource_queue_event() function will place the
event in the connection output buffer but not request the main loop to
poll for writable.  The effect is that the event will just sit in the
output buffer until a more important event comes around and requires
flushing.
2011-11-17 17:52:01 -05:00
Kristian Høgsberg
3a1e6df39a Add display event to acknowledge ID deletion
We need to make sure the client doesn't reuse an object ID until the
server has seen the destroy request.  When a client destroys an ID
the server will now respond with the display.delete_id event, which lets
the client block reuse until it receives the event.
2011-11-17 17:37:52 -05:00
Benjamin Franzke
3f1063f92a connection: Check object types in message parameters 2011-10-31 11:13:13 -04:00
Kristian Høgsberg
c8147edc3a Store objects in wl_map data structure
The wl_map data structure is just an array with a free-list that lets the
client recycle unused client IDs and keep range of client IDs under control.
2011-08-27 12:06:11 -04:00
Paulo Zanoni
1648109c84 connection: fix libffi usage, our functions return void
All clients were segfaulting on my machine.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2011-08-27 12:06:10 -04:00
Kristian Høgsberg
f6ede01b68 connection: Object ID 0 is not a valid new object ID 2011-08-16 22:33:36 -04:00
Kristian Høgsberg
4c260db68c Rename source subdir from wayland to src 2011-08-12 16:25:14 -04:00
Renamed from wayland/connection.c (Browse further)