diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2011-01-19 14:08:21 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-01-19 14:25:12 -0500 |
commit | 65772ce18b0e28e8282883edf5ac4c02b11c33bd (patch) | |
tree | 37e004fce521b2f834188a3a373ccf4eb9f0659f | |
parent | 943741cb40a5e2691c5a95a8c253dee69f0c86b0 (diff) |
Use different closures for sending and receiving
Otherwise we can end up overwriting data in the receive buffer as we
try to send it.
-rw-r--r-- | wayland/connection.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wayland/connection.c b/wayland/connection.c index e8e8357..0705c19 100644 --- a/wayland/connection.c +++ b/wayland/connection.c @@ -61,7 +61,7 @@ struct wl_connection { int fd; void *data; wl_connection_update_func_t update; - struct wl_closure closure; + struct wl_closure receive_closure, send_closure; }; union wl_value { @@ -362,7 +362,7 @@ wl_connection_vmarshal(struct wl_connection *connection, uint32_t opcode, va_list ap, const struct wl_message *message) { - struct wl_closure *closure = &connection->closure; + struct wl_closure *closure = &connection->send_closure; struct wl_object **objectp, *object; uint32_t length, *p, *start, size; int dup_fd; @@ -487,7 +487,7 @@ wl_connection_demarshal(struct wl_connection *connection, int i, count, extra_space; struct wl_object **object; struct wl_array **array; - struct wl_closure *closure = &connection->closure; + struct wl_closure *closure = &connection->receive_closure; count = strlen(message->signature) + 2; if (count > ARRAY_LENGTH(closure->types)) { |