aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDima Krasner <dima@dimakrasner.com>2023-11-07 13:51:06 +0200
committerFelix Queißner <felix@ib-queissner.de>2023-11-09 08:20:12 +0100
commitb2fac23783a99519469961e64a51656c76b8ed50 (patch)
treecc622001d63b7cf29c0ba889bb6e035cbaefed6f
parentb84f4ba5ddff171efc28a002e66a23a212199380 (diff)
fix failure when first chunk arrives last
-rw-r--r--src/protocols/guppyclient.cpp4
1 files 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;