]> git.proxmox.com Git - mirror_qemu.git/commit
io: send proper HTTP response for websocket errors
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 6 Sep 2017 10:33:17 +0000 (11:33 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 4 Oct 2017 12:21:53 +0000 (13:21 +0100)
commitf69a8bde29354493ff8aea64cc9cb3b531d16337
treea5792dbbfac78fcc4d666d95c4ac0b7e1ac34c31
parentd147f7e815f97cb477e223586bcb80c316ae10ea
io: send proper HTTP response for websocket errors

When any error occurs while processing the websockets handshake,
QEMU just terminates the connection abruptly. This is in violation
of the HTTP specs and does not help the client understand what they
did wrong. This is particularly bad when the client gives the wrong
path, as a "404 Not Found" would be very helpful.

Refactor the handshake code so that it always sends a response to
the client unless there was an I/O error.

Fixes bug: #1715186

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
io/channel-websock.c