]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix max stream packet size for old clients
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 30 Sep 2013 16:27:51 +0000 (17:27 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 1 Oct 2013 12:59:12 +0000 (13:59 +0100)
The libvirtd server pushes data out to clients. It does not
know what protocol version the client might have, so must be
conservative and use the old payload limits. ie send no more
than 256kb of data per packet.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 27e81517a876dcb738dd8a9bb2e0e68d71c3b7e3)

daemon/stream.c
src/rpc/virnetprotocol.x

index 0fb5c8523130e93ce03470f499968e16367619fd..2bb3be0d33aebd721562531e878278770c945241 100644 (file)
@@ -710,7 +710,7 @@ daemonStreamHandleRead(virNetServerClientPtr client,
                        daemonClientStream *stream)
 {
     char *buffer;
-    size_t bufferLen = VIR_NET_MESSAGE_PAYLOAD_MAX;
+    size_t bufferLen = VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX;
     int ret;
 
     VIR_DEBUG("client=%p, stream=%p tx=%d closed=%d",
index 131e40b1c3fefc2704ba9b6a01655365f31ad113..1eae7cb80f718915bfbd01e4b72787f622f6b302 100644 (file)
  */
 const VIR_NET_MESSAGE_INITIAL = 65536;
 
+/*
+ * Until we enlarged the message buffers, this was the max
+ * payload size. We need to remember this for compat with
+ * old clients.
+ */
+const VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX = 262144;
+
 /* Maximum total message size (serialised). */
 const VIR_NET_MESSAGE_MAX = 16777216;