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 <brandon.carpenter@cypherpath.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Brandon Carpenter 2017-09-12 08:21:52 -07:00 committed by Daniel P. Berrange
parent 01af17fc00
commit 268a53f50d
2 changed files with 45 additions and 22 deletions

View file

@ -60,6 +60,7 @@ struct QIOChannelWebsock {
Buffer encoutput;
Buffer rawinput;
Buffer rawoutput;
Buffer ping_reply;
size_t payload_remain;
QIOChannelWebsockMask mask;
guint io_tag;