Commit 6532dceb authored by Peter Maydell's avatar Peter Maydell
Browse files

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: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 62a172e6 dd154c4d
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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;
}