Files
qemu/ui
Ding Hui 2ddafce7f7 vnc: fix resource leak when websocket channel error
When we connect to vnc by websocket channel, and disconnect
(maybe by some network exception) before handshake,
qemu will left CLOSE_WAIT socket and never close it

After 04d2529da2 ("ui: convert VNC server to use QIOChannelSocket")
and dd154c4d9f ("io: fix handling of EOF / error conditions in websock GSource"),
the vnc call qio_channel_add_watch only care about G_IO_IN,
but mising G_IO_HUP and G_IO_ERR.
When the websocket channel get EOF or error, it cannot callback,
because the caller ignore the event, that leads to resource leak

We need handle G_IO_HUP and G_IO_ERR event, then cleanup the channel

Fixes: 04d2529da2 ("ui: convert VNC server to use QIOChannelSocket")
Fixes: dd154c4d9f ("io: fix handling of EOF / error conditions in websock GSource")
Cc: qemu-stable@nongnu.org
Signed-off-by: Ding Hui <dinghui@sangfor.com.cn>
Message-id: 20201029032241.11040-1-dinghui@sangfor.com.cn
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-11-04 08:25:17 +01:00
..
2020-09-30 19:09:19 +02:00
2020-10-14 10:20:26 +02:00
2019-03-11 08:39:02 +01:00
2019-09-17 13:42:02 +02:00
2019-09-17 13:42:02 +02:00
2019-08-16 13:31:52 +02:00
2020-10-14 06:05:56 +02:00
2020-08-21 06:30:21 -04:00
2017-07-27 14:23:09 +02:00
2019-08-16 13:31:52 +02:00
2019-02-05 16:50:18 +01:00
2020-10-14 06:05:56 +02:00