Open fmwviormv opened 1 year ago
Thanks but this is not enough - fetch_poll
does not free cause
when io_polln
returns EAGAIN
.
If you set cause
on EAGAIN
then you need need to check all calls to io_polln
or io_poll
and make sure they free it.
So we have a complex situation. There are 2 types of EAGAIN error:
poll
return value -1
which leads to io_poll
to return -1
with initialized cause
poll
return value 0
which leads to io_poll
to return -1
with uninitialized cause
It is a little complex
So we have a complex situation. There are 2 types of EAGAIN error:
poll
return value-1
which leads toio_poll
to return-1
with initializedcause
poll
return value0
which leads toio_poll
to return-1
with uninitializedcause
It is a little complex
I think we need to separate these 2 situations, because the second one is not a real error. In my situation io_wait waits for SOCKS5 to recv few bytes, but SOCKS5 server might close the connection instead. In that situation there is no actual EAGAIN, so we should never wait again.
Either it should always initialize cause
when returning EAGAIN
and all callers should free it, or it should never initialize cause
when returning EAGAIN
and no callers should free it.
It doesn't really matter which but you will need to change io_polln
to do the same thing whether poll
actually returns EAGAIN
or we pretend it does when poll
returns 0 and there is no timeout, and then check all the callers.
There is a bug on certain situations that cause remain uninitialized, fdm will show these lines on my OpenBSD:
This patch is to initialize cause on my situation (I didn't find any other uninitialized cause)