Message ID | 20240303093304.1356981-4-mjt@tls.msk.ru (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Patch Round-up for stable 8.2.2, freeze on 2024-03-02 (frozen) | expand |
diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 73947da188..034840593d 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -492,9 +492,9 @@ static gboolean tcp_chr_read(QIOChannel *chan, GIOCondition cond, void *opaque) s->max_size <= 0) { return TRUE; } - len = sizeof(buf); - if (len > s->max_size) { - len = s->max_size; + len = tcp_chr_read_poll(opaque); + if (len > sizeof(buf)) { + len = sizeof(buf); } size = tcp_chr_recv(chr, (void *)buf, len); if (size == 0 || (size == -1 && errno != EAGAIN)) {