Merge I/O patch queue

Fix problem with end of file handling with websock channels
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJcknDrAAoJEL6G67QVEE/fkX4P/AuS6FajC4Ng57iEV1qnduov
 wmg0DPv/+QvXETyw3Zc8VCClnHQ2cDbBF7E+Ach2LKAhWEDz7DHc8bRfmwnEHKrc
 zBCrx/5TdwspKzB/wg6uyUkJLLAyM0pPDUXpBnkWpk+ixqcU8fC9cMhsRXdhtn2q
 AsZZqYt2gDmpx42zag8OwixFb6q3UazJmzqz00Q03H5ilnfiV987JcuGP1lSWxoz
 QTZGaGoh2Lxy7cNjK9fRYMVXiOFWikTCd2DFqINoKqGIlGR/wFncYqNS8QXSlGa5
 AaAumnzOBzm/JJEI+n/pr47JJ5xsuMJNafLkImLhcSBRBi1mO+proLZNxLnQDKRv
 rBaX4mSjb+IkWk8vy49VgCgO0HTiFeTyDAB6QtppsDcnrTWZtX1O1yZt43bQI3mp
 uwQAPsZpEwjryuGTHBxjm/rS5zMZht0Ro7+UzRqtejVCAPNrBPyLfEZkZhyqZtWn
 9TqTMTBOSMerLmYycPMD4Q3ELB5x5weZXmPiPw6dSVZUw9c2pbQr4YHzxAQUXTCR
 aP21G6ap3Iv6kXiTIlvTzzWi4dPfNX8oxrHIWXwn1jn+B53I7WkmEMC3x7QvKp0T
 D9c9ynZd9Wm1txWbplYh7ZIGxE0stSdx0CkCQ5taTrQYBg2rsEenUh0xZuz2fxD5
 36B/N8bSQHqshMwHBnlo
 =U5OM
 -----END PGP SIGNATURE-----

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>
This commit is contained in:
Peter Maydell 2019-03-21 09:33:11 +00:00
commit 6532dcebb6

View File

@ -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;
}