io: get rid of bounce buffering in websock write path
commit8dfd5f96515ca20c4eb109cb0ee28e2bb32fc505
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 9 Oct 2017 15:54:07 +0000 (9 16:54 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 16 Oct 2017 15:57:08 +0000 (16 16:57 +0100)
treeefe8a11fd65642f3a7c3c22ad53609827eb797f8
parentfb74e5903914b9ec8c80b6f7a35da000f9f92ae7
io: get rid of bounce buffering in websock write path

Currently most outbound I/O on the websock channel gets copied into the
rawoutput buffer, and then immediately copied again into the encoutput
buffer, with a header prepended. Now that qio_channel_websock_encode
accepts a struct iovec, we can trivially remove this bounce buffering
and write directly to encoutput.

In doing so, we also now correctly validate the encoutput size against
the QIO_CHANNEL_WEBSOCK_MAX_BUFFER limit.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
include/io/channel-websock.h
io/channel-websock.c