Fix WS reads when fragmented packets are sent.

This commit is contained in:
Roger A. Light
2022-04-28 07:13:58 +01:00
parent 75be1ed643
commit 4f294a715b

View File

@@ -286,7 +286,7 @@ ssize_t net__read_ws(struct mosquitto *mosq, void *buf, size_t count)
if(mosq->wsd.payloadlen > 0){
if(count > mosq->wsd.payloadlen - (uint64_t)mosq->wsd.pos){
count = mosq->wsd.payloadlen - (uint64_t)mosq->wsd.pos + 1;
count = mosq->wsd.payloadlen - (uint64_t)mosq->wsd.pos;
}
len = net__read(mosq, buf, count);
if(len > 0){