...
This commit is contained in:
@@ -153,7 +153,7 @@ flush_pending(id_type id, PendingData *pending) {
|
||||
remove_i_from_array(pending->items, 0, pending->count);
|
||||
}
|
||||
}
|
||||
return pending->count > 0;
|
||||
return pending->count == 0;
|
||||
}
|
||||
|
||||
#define check_for_pending_writes() \
|
||||
@@ -164,14 +164,14 @@ flush_pending_payloads(id_type timer_id UNUSED, void *x) {
|
||||
id_type id = (uintptr_t)x;
|
||||
Window *w = window_for_window_id(id);
|
||||
if (w && w->drop.wanted) {
|
||||
if (flush_pending(w->id, &w->drop.pending)) check_for_pending_writes();
|
||||
if (!flush_pending(w->id, &w->drop.pending)) check_for_pending_writes();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
queue_payload_to_child(id_type id, PendingData *pending, const char *header, size_t header_sz, const char *data, size_t data_sz, bool as_base64) {
|
||||
size_t offset = 0;
|
||||
if (!flush_pending(id, pending)) offset = send_payload_to_child(id, header, header_sz, data, data_sz, as_base64);
|
||||
if (flush_pending(id, pending)) offset = send_payload_to_child(id, header, header_sz, data, data_sz, as_base64);
|
||||
if (offset < data_sz || (!offset && !data_sz)) {
|
||||
ensure_space_for(pending, items, PendingEntry, pending->count + 1, capacity, 32, true);
|
||||
char *buf = malloc(header_sz + data_sz - offset);
|
||||
|
||||
Reference in New Issue
Block a user