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
This commit is contained in:
Wim Taymans 2022-01-28 16:23:42 +01:00
parent 1ac1f914e3
commit ce03fc7c15

View file

@ -38,6 +38,7 @@
#include "client.h" #include "client.h"
#include "commands.h" #include "commands.h"
#include "defs.h"
#include "internal.h" #include "internal.h"
#include "log.h" #include "log.h"
#include "message.h" #include "message.h"
@ -331,9 +332,12 @@ int stream_update_minreq(struct stream *stream, uint32_t minreq)
if (new_tlength <= old_tlength) if (new_tlength <= old_tlength)
return 0; return 0;
if (new_tlength > MAXLENGTH)
new_tlength = MAXLENGTH;
stream->attr.tlength = new_tlength; stream->attr.tlength = new_tlength;
if (stream->attr.tlength > stream->attr.maxlength) if (stream->attr.tlength > stream->attr.maxlength)
stream->attr.tlength = stream->attr.maxlength; stream->attr.maxlength = stream->attr.tlength;
if (client->version >= 15) { if (client->version >= 15) {
struct message *msg; struct message *msg;