1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-12 00:28:06 -05:00
Simon Tatham 78974fce89 pollwrap: stop returning unasked-for rwx statuses.
The sets of poll(2) events that we check in order to return SELECT_R
and SELECT_W overlap: to be precise, they have POLLERR in common. So
if an fd signals POLLERR, then pollwrap_get_fd_rwx will respond by
saying that it has both SELECT_R and SELECT_W available on it - even
if the caller had only asked for one of those.

In other words, you can get a spurious SELECT_W notification on an fd
that you never asked for SELECT_W on in the first place. This
definitely isn't what I'd meant that API to do.

In particular, if a socket in the middle of an asynchronous connect()
signals POLLERR, then Unix Plink will call select_result for it with
SELECT_R and then SELECT_W respectively. The former will notice that
it's got an error condition and call plug_closing - and _then_ the
latter will decide that it's writable and set s->connected! The plan
was to only select it for write until it was connected, but this bug
in pollwrap was defeating that plan.

Now pollwrap_get_fd_rwx should only ever return a set of rwx flags
that's a subset of the one that the client asked for via
pollwrap_add_fd_rwx.
2020-02-06 23:52:19 +00:00
..
2020-02-02 10:02:10 +00:00
2019-03-31 10:35:10 +01:00
2020-01-30 06:40:21 +00:00
2019-10-14 19:42:37 +01:00
2020-01-30 06:40:21 +00:00
2020-01-21 20:24:04 +00:00
2020-02-02 22:57:59 +00:00
2020-02-02 10:02:10 +00:00
2020-01-30 06:40:21 +00:00
2019-10-14 19:42:37 +01:00
2020-01-21 20:24:04 +00:00