diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-03-21 09:33:11 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-03-21 09:33:11 +0000 |
commit | 6532dcebb6160f94b6b278af5e73784164c669f6 (patch) | |
tree | 631956f639cfeb4def77abda251511f9ee5e500a | |
parent | 62a172e6a77d9072bb1a18f295ce0fcf4b90a4f2 (diff) | |
parent | dd154c4d9f48a44ad24e13f46033d0f10a05c923 (diff) |
Merge remote-tracking branch 'remotes/berrange/tags/qio-next-pull-request' into staging
Merge I/O patch queue
Fix problem with end of file handling with websock channels
# gpg: Signature made Wed 20 Mar 2019 16:57:15 GMT
# gpg: using RSA key BE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg: aka "Daniel P. Berrange <berrange@redhat.com>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF
* remotes/berrange/tags/qio-next-pull-request:
io: fix handling of EOF / error conditions in websock GSource
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | io/channel-websock.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/io/channel-websock.c b/io/channel-websock.c index dc43dc6bb9..77d30f0e4a 100644 --- a/io/channel-websock.c +++ b/io/channel-websock.c @@ -1225,12 +1225,18 @@ qio_channel_websock_source_check(GSource *source) QIOChannelWebsockSource *wsource = (QIOChannelWebsockSource *)source; GIOCondition cond = 0; - if (wsource->wioc->rawinput.offset || wsource->wioc->io_eof) { + if (wsource->wioc->rawinput.offset) { cond |= G_IO_IN; } if (wsource->wioc->encoutput.offset < QIO_CHANNEL_WEBSOCK_MAX_BUFFER) { cond |= G_IO_OUT; } + if (wsource->wioc->io_eof) { + cond |= G_IO_HUP; + } + if (wsource->wioc->io_err) { + cond |= G_IO_ERR; + } return cond & wsource->condition; } |