From ce03fc7c158c66c59f9fa4201f0962e0edc3478e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 28 Jan 2022 16:23:42 +0100 Subject: [PATCH] pulse-server: increase maxlength to match tlength When we need to increase tlength because of a quantum change, increase maxlength as well, but clamp it to MAXLENGTH. See #2069 --- src/modules/module-protocol-pulse/stream.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/stream.c b/src/modules/module-protocol-pulse/stream.c index dc4fdbf2c..2a2e1a6c4 100644 --- a/src/modules/module-protocol-pulse/stream.c +++ b/src/modules/module-protocol-pulse/stream.c @@ -38,6 +38,7 @@ #include "client.h" #include "commands.h" +#include "defs.h" #include "internal.h" #include "log.h" #include "message.h" @@ -331,9 +332,12 @@ int stream_update_minreq(struct stream *stream, uint32_t minreq) if (new_tlength <= old_tlength) return 0; + if (new_tlength > MAXLENGTH) + new_tlength = MAXLENGTH; + stream->attr.tlength = new_tlength; if (stream->attr.tlength > stream->attr.maxlength) - stream->attr.tlength = stream->attr.maxlength; + stream->attr.maxlength = stream->attr.tlength; if (client->version >= 15) { struct message *msg;