From b2fac23783a99519469961e64a51656c76b8ed50 Mon Sep 17 00:00:00 2001 From: Dima Krasner Date: Tue, 7 Nov 2023 13:51:06 +0200 Subject: [PATCH] fix failure when first chunk arrives last --- src/protocols/guppyclient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protocols/guppyclient.cpp b/src/protocols/guppyclient.cpp index d07ce23..d23cb5e 100644 --- a/src/protocols/guppyclient.cpp +++ b/src/protocols/guppyclient.cpp @@ -168,7 +168,7 @@ void GuppyClient::on_readRead() break; } body.append(next.constData(), next.size()); - this->prev_seq = next_seq; + this->prev_seq = next_seq++; } if(not this->was_cancelled) { @@ -176,7 +176,7 @@ void GuppyClient::on_readRead() } // we're done when the last appended chunk is the one before the eof chunk - if(next_seq == this->last_seq) { + if(this->last_seq && next_seq == this->last_seq) { if(not this->was_cancelled) { emit this->requestComplete(this->body, this->mime); this->was_cancelled = true;