Compare commits

...

3 Commits

Author SHA1 Message Date
Lennart Poettering b47bce3cf1
Merge 2af2e3e799 into 5b2926d941 2024-11-23 22:47:51 -08:00
Yu Watanabe 5b2926d941 curl-util: do not configure new io event source when the event loop is already dead
Similar to c5ecf09494, but for io event source.

Fixes #35322.
2024-11-23 22:49:57 +01:00
Lennart Poettering 2af2e3e799 sd-varlink: fix bug when enqueuing messages with fds asynchronously
When determining the poll events to wait for we need to take the queue
of pending messages that carry fds into account. Otherwise we might end
up not waking up if such an fd-carrying message is enqueued
asynchronously (i.e. not from a dispatch callback).
2024-11-20 15:09:18 +01:00
2 changed files with 6 additions and 1 deletions

View File

@ -75,6 +75,10 @@ static int curl_glue_socket_callback(CURL *curl, curl_socket_t s, int action, vo
return 0;
}
/* Don't configure io event source anymore when the event loop is dead already. */
if (g->event && sd_event_get_state(g->event) == SD_EVENT_FINISHED)
return 0;
r = hashmap_ensure_allocated(&g->ios, &trivial_hash_ops);
if (r < 0) {
log_oom();

View File

@ -1698,7 +1698,8 @@ _public_ int sd_varlink_get_events(sd_varlink *v) {
ret |= EPOLLIN;
if (!v->write_disconnected &&
v->output_buffer_size > 0)
(v->output_queue ||
v->output_buffer_size > 0))
ret |= EPOLLOUT;
return ret;