Skip to content

slirp_update_timeout: Fix handling of *timeout = 0

Rafael Gieschke requested to merge rafaelgieschke/libslirp:fix-timeout into master

libslirp-rs in https://gitlab.freedesktop.org/slirp/libslirp-rs/-/blob/a82279f34a6896ff77e05e0af4828c2d5c900f34/src/mio.rs#L286-287 actually sets *timeout = 0 before calling slirp_pollfds_fill().

Currently, this results in *timeout staying at 0 and all (TCP) timeouts never firing on their own (they will only fire randomly if a file descriptor becomes ready eventually).

You could, alternatively, argue that libslirp-rs should let mut timeout = u32::MAX but 0 seems like a more reasonable default value for timeout.

Signed-off-by: Rafael Gieschke rafael@gieschke.de

Merge request reports

Loading