fix failure when first chunk arrives last

This commit is contained in:
Dima Krasner 2023-11-07 13:51:06 +02:00 committed by Felix Queißner
parent b84f4ba5dd
commit b2fac23783
1 changed files with 2 additions and 2 deletions

View File

@ -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;