}
void
-wl_closure_print(struct wl_closure *closure, struct wl_object *target, int send)
+wl_closure_print(struct wl_closure *closure, struct wl_object *target,
+ int send, int discarded)
{
int i;
struct argument_details arg;
clock_gettime(CLOCK_REALTIME, &tp);
time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000);
- fprintf(stderr, "[%10.3f] %s%s@%u.%s(",
+ fprintf(stderr, "[%10.3f] %s%s%s@%u.%s(",
time / 1000.0,
+ discarded ? "discarded " : "",
send ? " -> " : "",
target->interface->name, target->id,
closure->message->name);
}
if (debug_client)
- wl_closure_print(closure, &proxy->object, true);
+ wl_closure_print(closure, &proxy->object, true, false);
if (wl_closure_send(closure, proxy->display->connection)) {
wl_log("Error sending request: %s\n", strerror(errno));
struct wl_closure *closure;
const struct wl_message *message;
struct wl_event_queue *queue;
+ struct timespec tp;
+ unsigned int time;
+ int num_zombie_fds;
wl_connection_copy(display->connection, p, sizeof p);
id = p[0];
proxy = wl_map_lookup(&display->objects, id);
if (!proxy || wl_object_is_zombie(&display->objects, id)) {
struct wl_zombie *zombie = wl_map_lookup(&display->objects, id);
-
- if (zombie && zombie->fd_count[opcode])
+ num_zombie_fds = (zombie && opcode < zombie->event_count) ?
+ zombie->fd_count[opcode] : 0;
+
+ if (debug_client) {
+ clock_gettime(CLOCK_REALTIME, &tp);
+ time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000);
+
+ fprintf(stderr, "[%10.3f] discarded [%s]@%d.[event %d]"
+ "(%d fd, %d byte)\n",
+ time / 1000.0,
+ zombie ? "zombie" : "unknown",
+ id, opcode,
+ num_zombie_fds, size);
+ }
+ if (num_zombie_fds > 0)
wl_connection_close_fds_in(display->connection,
- zombie->fd_count[opcode]);
+ num_zombie_fds);
wl_connection_consume(display->connection, size);
return size;
proxy = closure->proxy;
proxy_destroyed = !!(proxy->flags & WL_PROXY_FLAG_DESTROYED);
if (proxy_destroyed) {
+ if (debug_client)
+ wl_closure_print(closure, &proxy->object, false, true);
destroy_queued_closure(closure);
return;
}
if (proxy->dispatcher) {
if (debug_client)
- wl_closure_print(closure, &proxy->object, false);
+ wl_closure_print(closure, &proxy->object, false, false);
wl_closure_dispatch(closure, proxy->dispatcher,
&proxy->object, opcode);
} else if (proxy->object.implementation) {
if (debug_client)
- wl_closure_print(closure, &proxy->object, false);
+ wl_closure_print(closure, &proxy->object, false, false);
wl_closure_invoke(closure, WL_CLOSURE_INVOKE_CLIENT,
&proxy->object, opcode, proxy->user_data);