summaryrefslogtreecommitdiffstats
path: root/src/wayland-server.c
diff options
context:
space:
mode:
authorJaeyoon Jung <jaeyoon.jung@lge.com>2016-01-12 13:12:34 +0900
committerDerek Foreman <derekf@osg.samsung.com>2016-01-12 10:45:33 -0600
commit0a37511ecc0117339e5e5d0add84a2f3b51493d2 (patch)
treee20532c9ab0067097876811d88c2009cc15feb1a /src/wayland-server.c
parentdoc: Fix incorrect parameter name (diff)
downloadwayland-0a37511ecc0117339e5e5d0add84a2f3b51493d2.tar
wayland-0a37511ecc0117339e5e5d0add84a2f3b51493d2.tar.gz
wayland-0a37511ecc0117339e5e5d0add84a2f3b51493d2.tar.bz2
wayland-0a37511ecc0117339e5e5d0add84a2f3b51493d2.tar.lz
wayland-0a37511ecc0117339e5e5d0add84a2f3b51493d2.tar.xz
wayland-0a37511ecc0117339e5e5d0add84a2f3b51493d2.tar.zst
wayland-0a37511ecc0117339e5e5d0add84a2f3b51493d2.zip
server: Calculate remaining data size after a closure is processed
When processing a closure, data in the connection can be consumed again if the closure itself invokes extra event dispatch. In that case the remaining data size is also altered, so the variable len should be updated after the closure is processed. Signed-off-by: Jaeyoon Jung <jaeyoon.jung@lge.com> Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Diffstat (limited to 'src/wayland-server.c')
-rw-r--r--src/wayland-server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wayland-server.c b/src/wayland-server.c
index 9e26b18..2158c08 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -313,7 +313,6 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
closure = wl_connection_demarshal(client->connection, size,
&client->objects, message);
- len -= size;
if (closure == NULL && errno == ENOMEM) {
wl_resource_post_no_memory(resource);
@@ -346,6 +345,8 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
if (client->error)
break;
+
+ len = wl_connection_pending_input(connection);
}
if (client->error)