Browse Source

[core] chunkqueue_compact_mem() must upd cq->last

master
Glenn Strauss 2 years ago
parent
commit
d2d5f27f80
  1. 2
      src/chunk.c

2
src/chunk.c

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

Loading…
Cancel
Save