[core] chunkqueue_compact_mem() must upd cq->last
@@ -773,6 +773,7 @@ void chunkqueue_compact_mem(chunkqueue *cq, size_t clen) {
b = chunkqueue_prepend_buffer_open_sz(cq, clen + 8192);
buffer_append_string_len(b, c->mem->ptr + c->offset, len);
cq->first->next = c->next;
+ if (NULL == c->next) cq->last = cq->first;
chunk_release(c);
c = cq->first;
}
@@ -781,6 +782,7 @@ void chunkqueue_compact_mem(chunkqueue *cq, size_t clen) {
if (len > clen) len = clen;
buffer_append_string_len(b, c->mem->ptr + c->offset, len);
fc->next = c->next;
+ if (NULL == c->next) cq->last = fc;
chunk_release(c);
}
/* chunkqueue_prepend_buffer_commit() is not called here;
