qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] f69a8b: io: send proper HTTP response for web


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] f69a8b: io: send proper HTTP response for websocket errors
Date: Thu, 05 Oct 2017 07:29:51 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: f69a8bde29354493ff8aea64cc9cb3b531d16337
      
https://github.com/qemu/qemu/commit/f69a8bde29354493ff8aea64cc9cb3b531d16337
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-10-04 (Wed, 04 Oct 2017)

  Changed paths:
    M io/channel-websock.c

  Log Message:
  -----------
  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é <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: 3a3f8705962c8c8a47a9b981ffd5aab7274ad508
      
https://github.com/qemu/qemu/commit/3a3f8705962c8c8a47a9b981ffd5aab7274ad508
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-10-04 (Wed, 04 Oct 2017)

  Changed paths:
    M io/channel-websock.c
    M io/trace-events

  Log Message:
  -----------
  io: include full error message in websocket handshake trace

When the websocket handshake fails it is useful to log the real
error message via the trace points for debugging purposes.

Fixes bug: #1715186

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: 33badfd1e3735b877e41939100511c65572be6b9
      
https://github.com/qemu/qemu/commit/33badfd1e3735b877e41939100511c65572be6b9
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-10-04 (Wed, 04 Oct 2017)

  Changed paths:
    M io/channel-websock.c

  Log Message:
  -----------
  io: use case insensitive check for Connection & Upgrade websock headers

When checking the value of the Connection and Upgrade HTTP headers
the websock RFC (6455) requires the comparison to be case insensitive.
The Connection value should be an exact match not a substring.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: a75d6f07613af7ec5b016b31b117436e32ce7a5f
      
https://github.com/qemu/qemu/commit/a75d6f07613af7ec5b016b31b117436e32ce7a5f
  Author: Brandon Carpenter <address@hidden>
  Date:   2017-10-04 (Wed, 04 Oct 2017)

  Changed paths:
    M ui/vnc-auth-vencrypt.c
    M ui/vnc-ws.c
    M ui/vnc.c

  Log Message:
  -----------
  ui: Always remove an old VNC channel watch before adding a new one

Also set saved handle to zero when removing without adding a new watch.

Signed-off-by: Brandon Carpenter <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>


  Commit: eefa3d8ef649f9055611361e2201cca49f8c3433
      
https://github.com/qemu/qemu/commit/eefa3d8ef649f9055611361e2201cca49f8c3433
  Author: Brandon Carpenter <address@hidden>
  Date:   2017-10-04 (Wed, 04 Oct 2017)

  Changed paths:
    M io/channel-websock.c

  Log Message:
  -----------
  io: Small updates in preparation for websocket changes

Gets rid of unnecessary bit shifting and performs proper EOF checking to
avoid a large number of repeated calls to recvmsg() when a client
abruptly terminates a connection (bug fix).

Signed-off-by: Brandon Carpenter <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: ff1300e626949fa9850b0f91dc5e8c2cb45b6a88
      
https://github.com/qemu/qemu/commit/ff1300e626949fa9850b0f91dc5e8c2cb45b6a88
  Author: Brandon Carpenter <address@hidden>
  Date:   2017-10-04 (Wed, 04 Oct 2017)

  Changed paths:
    M include/io/channel-websock.h
    M io/channel-websock.c

  Log Message:
  -----------
  io: Add support for fragmented websocket binary frames

Allows fragmented binary frames by saving the previous opcode. Handles
the case where an intermediary (i.e., web proxy) fragments frames
originally sent unfragmented by the client.

Signed-off-by: Brandon Carpenter <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: 3a29640e2cbae9d47b89ffaf98ed358920eb6797
      
https://github.com/qemu/qemu/commit/3a29640e2cbae9d47b89ffaf98ed358920eb6797
  Author: Brandon Carpenter <address@hidden>
  Date:   2017-10-04 (Wed, 04 Oct 2017)

  Changed paths:
    M io/channel-websock.c

  Log Message:
  -----------
  io: Allow empty websocket payload

Some browsers send pings/pongs with no payload, so allow empty payloads
instead of closing the connection.

Signed-off-by: Brandon Carpenter <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: 01af17fc002414ee1ac0800babfb0edc2bef1a7d
      
https://github.com/qemu/qemu/commit/01af17fc002414ee1ac0800babfb0edc2bef1a7d
  Author: Brandon Carpenter <address@hidden>
  Date:   2017-10-04 (Wed, 04 Oct 2017)

  Changed paths:
    M io/channel-websock.c

  Log Message:
  -----------
  io: Ignore websocket PING and PONG frames

Keep pings and gratuitous pongs generated by web browsers from killing
websocket connections.

Signed-off-by: Brandon Carpenter <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: 268a53f50de795481dd73ffd0e0c1339ad3dc44b
      
https://github.com/qemu/qemu/commit/268a53f50de795481dd73ffd0e0c1339ad3dc44b
  Author: Brandon Carpenter <address@hidden>
  Date:   2017-10-04 (Wed, 04 Oct 2017)

  Changed paths:
    M include/io/channel-websock.h
    M io/channel-websock.c

  Log Message:
  -----------
  io: Reply to ping frames

Add an immediate ping reply (pong) to the outgoing stream when a ping
is received. Unsolicited pongs are ignored.

Signed-off-by: Brandon Carpenter <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: 530ca60c16c83435d4becc9916d74fa43e003815
      
https://github.com/qemu/qemu/commit/530ca60c16c83435d4becc9916d74fa43e003815
  Author: Brandon Carpenter <address@hidden>
  Date:   2017-10-04 (Wed, 04 Oct 2017)

  Changed paths:
    M io/channel-websock.c

  Log Message:
  -----------
  io: Attempt to send websocket close messages to client

Make a best effort attempt to close websocket connections according to
the RFC. Sends the close message, as room permits in the socket buffer,
and immediately closes the socket.

Signed-off-by: Brandon Carpenter <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: 59f183bbd54eecffb8915bffe03f9c2720b28bcc
      
https://github.com/qemu/qemu/commit/59f183bbd54eecffb8915bffe03f9c2720b28bcc
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-10-04 (Wed, 04 Oct 2017)

  Changed paths:
    M io/channel-websock.c
    M io/trace-events

  Log Message:
  -----------
  io: add trace events for websockets frame handling

It is useful to trace websockets frame encoding/decoding when debugging
problems.

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: 1fdc4c5d82a6a4b327776f10ad435eb8bdd70089
      
https://github.com/qemu/qemu/commit/1fdc4c5d82a6a4b327776f10ad435eb8bdd70089
  Author: Peter Maydell <address@hidden>
  Date:   2017-10-05 (Thu, 05 Oct 2017)

  Changed paths:
    M include/io/channel-websock.h
    M io/channel-websock.c
    M io/trace-events
    M ui/vnc-auth-vencrypt.c
    M ui/vnc-ws.c
    M ui/vnc.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/berrange/tags/pull-qio-2017-10-04-1' 
into staging

Merge qio 2017/10/04 v1

# gpg: Signature made Wed 04 Oct 2017 13:23:04 BST
# gpg:                using RSA key 0xBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <address@hidden>"
# gpg:                 aka "Daniel P. Berrange <address@hidden>"
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* remotes/berrange/tags/pull-qio-2017-10-04-1:
  io: add trace events for websockets frame handling
  io: Attempt to send websocket close messages to client
  io: Reply to ping frames
  io: Ignore websocket PING and PONG frames
  io: Allow empty websocket payload
  io: Add support for fragmented websocket binary frames
  io: Small updates in preparation for websocket changes
  ui: Always remove an old VNC channel watch before adding a new one
  io: use case insensitive check for Connection & Upgrade websock headers
  io: include full error message in websocket handshake trace
  io: send proper HTTP response for websocket errors

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/90586a78ffae...1fdc4c5d82a6

reply via email to

[Prev in Thread] Current Thread [Next in Thread]